pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Avoid double-free in vacuumlo error path. 6+ messages / 1 participants [nested] [flat]
* pgsql: Avoid double-free in vacuumlo error path. @ 2019-03-24 19:13 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2019-03-24 19:13 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid double-free in vacuumlo error path. The code would do "PQclear(res)" twice if lo_unlink failed, evidently due to careless thinking about how far out a "break" would break. Remove the extra PQclear and adjust the loop logic so that we'll fall out of both levels of loop after an error, as was clearly the intent. Spotted by Coverity. I have no idea why it took this long to notice, since the bug has been there since commit 67ccbb080. Accordingly, back-patch to all supported branches. Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/bd9396a0b2d42497f1196af74b327e00cb6af435 Modified Files -------------- contrib/vacuumlo/vacuumlo.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Avoid double-free in vacuumlo error path. @ 2019-03-24 19:13 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2019-03-24 19:13 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid double-free in vacuumlo error path. The code would do "PQclear(res)" twice if lo_unlink failed, evidently due to careless thinking about how far out a "break" would break. Remove the extra PQclear and adjust the loop logic so that we'll fall out of both levels of loop after an error, as was clearly the intent. Spotted by Coverity. I have no idea why it took this long to notice, since the bug has been there since commit 67ccbb080. Accordingly, back-patch to all supported branches. Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/b7ffa0ee8d55af0eb236d7496853c38c266d96d5 Modified Files -------------- contrib/vacuumlo/vacuumlo.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Avoid double-free in vacuumlo error path. @ 2019-03-24 19:13 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2019-03-24 19:13 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid double-free in vacuumlo error path. The code would do "PQclear(res)" twice if lo_unlink failed, evidently due to careless thinking about how far out a "break" would break. Remove the extra PQclear and adjust the loop logic so that we'll fall out of both levels of loop after an error, as was clearly the intent. Spotted by Coverity. I have no idea why it took this long to notice, since the bug has been there since commit 67ccbb080. Accordingly, back-patch to all supported branches. Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/e484f07015cdcb9b6ba772760f16fdf2d76c8b2f Modified Files -------------- contrib/vacuumlo/vacuumlo.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Avoid double-free in vacuumlo error path. @ 2019-03-24 19:13 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2019-03-24 19:13 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid double-free in vacuumlo error path. The code would do "PQclear(res)" twice if lo_unlink failed, evidently due to careless thinking about how far out a "break" would break. Remove the extra PQclear and adjust the loop logic so that we'll fall out of both levels of loop after an error, as was clearly the intent. Spotted by Coverity. I have no idea why it took this long to notice, since the bug has been there since commit 67ccbb080. Accordingly, back-patch to all supported branches. Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/9264888225ac4dabf399f06775073e14c38a87f7 Modified Files -------------- contrib/vacuumlo/vacuumlo.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Avoid double-free in vacuumlo error path. @ 2019-03-24 19:13 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2019-03-24 19:13 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid double-free in vacuumlo error path. The code would do "PQclear(res)" twice if lo_unlink failed, evidently due to careless thinking about how far out a "break" would break. Remove the extra PQclear and adjust the loop logic so that we'll fall out of both levels of loop after an error, as was clearly the intent. Spotted by Coverity. I have no idea why it took this long to notice, since the bug has been there since commit 67ccbb080. Accordingly, back-patch to all supported branches. Branch ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/171baf18325e30997123e9d5cf3e1a81e3a3f484 Modified Files -------------- contrib/vacuumlo/vacuumlo.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Avoid double-free in vacuumlo error path. @ 2019-03-24 19:13 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2019-03-24 19:13 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid double-free in vacuumlo error path. The code would do "PQclear(res)" twice if lo_unlink failed, evidently due to careless thinking about how far out a "break" would break. Remove the extra PQclear and adjust the loop logic so that we'll fall out of both levels of loop after an error, as was clearly the intent. Spotted by Coverity. I have no idea why it took this long to notice, since the bug has been there since commit 67ccbb080. Accordingly, back-patch to all supported branches. Branch ------ REL9_4_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/99e414cacd063550d576cb9b1acac503157a3bce Modified Files -------------- contrib/vacuumlo/vacuumlo.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2019-03-24 19:13 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2019-03-24 19:13 pgsql: Avoid double-free in vacuumlo error path. Tom Lane <tgl@sss.pgh.pa.us> 2019-03-24 19:13 pgsql: Avoid double-free in vacuumlo error path. Tom Lane <tgl@sss.pgh.pa.us> 2019-03-24 19:13 pgsql: Avoid double-free in vacuumlo error path. Tom Lane <tgl@sss.pgh.pa.us> 2019-03-24 19:13 pgsql: Avoid double-free in vacuumlo error path. Tom Lane <tgl@sss.pgh.pa.us> 2019-03-24 19:13 pgsql: Avoid double-free in vacuumlo error path. Tom Lane <tgl@sss.pgh.pa.us> 2019-03-24 19:13 pgsql: Avoid double-free in vacuumlo error path. Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox