pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Repair unsafe/unportable snprintf usage in pg_restore. 6+ messages / 1 participants [nested] [flat]
* pgsql: Repair unsafe/unportable snprintf usage in pg_restore. @ 2019-02-10 00:45 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2019-02-10 00:45 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Repair unsafe/unportable snprintf usage in pg_restore. warn_or_exit_horribly() was blithely passing a potentially-NULL string pointer to a %s format specifier. That works (at least to the extent of not crashing) on some platforms, but not all, and since we switched to our own snprintf.c it doesn't work for us anywhere. Of the three string fields being handled this way here, I think that only "owner" is supposed to be nullable ... but considering that this is error-reporting code, it has very little business assuming anything, so put in defenses for all three. Per a crash observed on buildfarm member crake and then reproduced here. Because of the portability aspect, back-patch to all supported versions. Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/2b6009e2a2794df286939e5ce1196a23cca07d68 Modified Files -------------- src/bin/pg_dump/pg_backup_archiver.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Repair unsafe/unportable snprintf usage in pg_restore. @ 2019-02-10 00:45 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2019-02-10 00:45 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Repair unsafe/unportable snprintf usage in pg_restore. warn_or_exit_horribly() was blithely passing a potentially-NULL string pointer to a %s format specifier. That works (at least to the extent of not crashing) on some platforms, but not all, and since we switched to our own snprintf.c it doesn't work for us anywhere. Of the three string fields being handled this way here, I think that only "owner" is supposed to be nullable ... but considering that this is error-reporting code, it has very little business assuming anything, so put in defenses for all three. Per a crash observed on buildfarm member crake and then reproduced here. Because of the portability aspect, back-patch to all supported versions. Branch ------ REL9_4_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/ed46d0d322b54b618557b88948c72bc2711d7c1b Modified Files -------------- src/bin/pg_dump/pg_backup_archiver.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Repair unsafe/unportable snprintf usage in pg_restore. @ 2019-02-10 00:45 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2019-02-10 00:45 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Repair unsafe/unportable snprintf usage in pg_restore. warn_or_exit_horribly() was blithely passing a potentially-NULL string pointer to a %s format specifier. That works (at least to the extent of not crashing) on some platforms, but not all, and since we switched to our own snprintf.c it doesn't work for us anywhere. Of the three string fields being handled this way here, I think that only "owner" is supposed to be nullable ... but considering that this is error-reporting code, it has very little business assuming anything, so put in defenses for all three. Per a crash observed on buildfarm member crake and then reproduced here. Because of the portability aspect, back-patch to all supported versions. Branch ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/2c833217713776d8606fb94e9ab3877d102b86a6 Modified Files -------------- src/bin/pg_dump/pg_backup_archiver.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Repair unsafe/unportable snprintf usage in pg_restore. @ 2019-02-10 00:45 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2019-02-10 00:45 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Repair unsafe/unportable snprintf usage in pg_restore. warn_or_exit_horribly() was blithely passing a potentially-NULL string pointer to a %s format specifier. That works (at least to the extent of not crashing) on some platforms, but not all, and since we switched to our own snprintf.c it doesn't work for us anywhere. Of the three string fields being handled this way here, I think that only "owner" is supposed to be nullable ... but considering that this is error-reporting code, it has very little business assuming anything, so put in defenses for all three. Per a crash observed on buildfarm member crake and then reproduced here. Because of the portability aspect, back-patch to all supported versions. Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/73668c590cf5c5719ac0d0481201fd4fd79454bb Modified Files -------------- src/bin/pg_dump/pg_backup_archiver.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Repair unsafe/unportable snprintf usage in pg_restore. @ 2019-02-10 00:45 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2019-02-10 00:45 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Repair unsafe/unportable snprintf usage in pg_restore. warn_or_exit_horribly() was blithely passing a potentially-NULL string pointer to a %s format specifier. That works (at least to the extent of not crashing) on some platforms, but not all, and since we switched to our own snprintf.c it doesn't work for us anywhere. Of the three string fields being handled this way here, I think that only "owner" is supposed to be nullable ... but considering that this is error-reporting code, it has very little business assuming anything, so put in defenses for all three. Per a crash observed on buildfarm member crake and then reproduced here. Because of the portability aspect, back-patch to all supported versions. Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/4dbe1969079672064777e71c3fc981abbf55e207 Modified Files -------------- src/bin/pg_dump/pg_backup_archiver.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Repair unsafe/unportable snprintf usage in pg_restore. @ 2019-02-10 00:45 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2019-02-10 00:45 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Repair unsafe/unportable snprintf usage in pg_restore. warn_or_exit_horribly() was blithely passing a potentially-NULL string pointer to a %s format specifier. That works (at least to the extent of not crashing) on some platforms, but not all, and since we switched to our own snprintf.c it doesn't work for us anywhere. Of the three string fields being handled this way here, I think that only "owner" is supposed to be nullable ... but considering that this is error-reporting code, it has very little business assuming anything, so put in defenses for all three. Per a crash observed on buildfarm member crake and then reproduced here. Because of the portability aspect, back-patch to all supported versions. Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/ef9bf359369b4dfaceb859941c3898b5ce1decf6 Modified Files -------------- src/bin/pg_dump/pg_backup_archiver.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2019-02-10 00:45 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2019-02-10 00:45 pgsql: Repair unsafe/unportable snprintf usage in pg_restore. Tom Lane <tgl@sss.pgh.pa.us> 2019-02-10 00:45 pgsql: Repair unsafe/unportable snprintf usage in pg_restore. Tom Lane <tgl@sss.pgh.pa.us> 2019-02-10 00:45 pgsql: Repair unsafe/unportable snprintf usage in pg_restore. Tom Lane <tgl@sss.pgh.pa.us> 2019-02-10 00:45 pgsql: Repair unsafe/unportable snprintf usage in pg_restore. Tom Lane <tgl@sss.pgh.pa.us> 2019-02-10 00:45 pgsql: Repair unsafe/unportable snprintf usage in pg_restore. Tom Lane <tgl@sss.pgh.pa.us> 2019-02-10 00:45 pgsql: Repair unsafe/unportable snprintf usage in pg_restore. 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