pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Avoid fetching one past the end of translate()'s "to" parameter. 6+ messages / 1 participants [nested] [flat]
* pgsql: Avoid fetching one past the end of translate()'s "to" parameter. @ 2023-03-01 16:30 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2023-03-01 16:30 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid fetching one past the end of translate()'s "to" parameter. This is usually harmless, but if you were very unlucky it could provoke a segfault due to the "to" string being right up against the end of memory. Found via valgrind testing (so we might've found it earlier, except that our regression tests lacked any exercise of translate()'s deletion feature). Fix by switching the order of the test-for-end-of-string and advance-pointer steps. While here, compute "to_ptr + tolen" just once. (Smarter compilers might figure that out for themselves, but let's just make sure.) Report and fix by Daniil Anisimov, in bug #17816. Discussion: https://postgr.es/m/17816-70f3d2764e88a108@postgresql.org Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/d7056bc1c71d2d876adb60dda8e0ba962e8279df Modified Files -------------- src/backend/utils/adt/oracle_compat.c | 12 +++++++----- src/test/regress/expected/strings.out | 6 ++++++ src/test/regress/sql/strings.sql | 1 + 3 files changed, 14 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Avoid fetching one past the end of translate()'s "to" parameter. @ 2023-03-01 16:30 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2023-03-01 16:30 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid fetching one past the end of translate()'s "to" parameter. This is usually harmless, but if you were very unlucky it could provoke a segfault due to the "to" string being right up against the end of memory. Found via valgrind testing (so we might've found it earlier, except that our regression tests lacked any exercise of translate()'s deletion feature). Fix by switching the order of the test-for-end-of-string and advance-pointer steps. While here, compute "to_ptr + tolen" just once. (Smarter compilers might figure that out for themselves, but let's just make sure.) Report and fix by Daniil Anisimov, in bug #17816. Discussion: https://postgr.es/m/17816-70f3d2764e88a108@postgresql.org Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/eae09137d53ecb9cb4c1ba7624723f1c1cbebeec Modified Files -------------- src/backend/utils/adt/oracle_compat.c | 12 +++++++----- src/test/regress/expected/strings.out | 6 ++++++ src/test/regress/sql/strings.sql | 1 + 3 files changed, 14 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Avoid fetching one past the end of translate()'s "to" parameter. @ 2023-03-01 16:30 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2023-03-01 16:30 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid fetching one past the end of translate()'s "to" parameter. This is usually harmless, but if you were very unlucky it could provoke a segfault due to the "to" string being right up against the end of memory. Found via valgrind testing (so we might've found it earlier, except that our regression tests lacked any exercise of translate()'s deletion feature). Fix by switching the order of the test-for-end-of-string and advance-pointer steps. While here, compute "to_ptr + tolen" just once. (Smarter compilers might figure that out for themselves, but let's just make sure.) Report and fix by Daniil Anisimov, in bug #17816. Discussion: https://postgr.es/m/17816-70f3d2764e88a108@postgresql.org Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/1a9356f657e19ae1abeb0ffea0b7edaf69e315cb Modified Files -------------- src/backend/utils/adt/oracle_compat.c | 12 +++++++----- src/test/regress/expected/strings.out | 6 ++++++ src/test/regress/sql/strings.sql | 1 + 3 files changed, 14 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Avoid fetching one past the end of translate()'s "to" parameter. @ 2023-03-01 16:30 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2023-03-01 16:30 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid fetching one past the end of translate()'s "to" parameter. This is usually harmless, but if you were very unlucky it could provoke a segfault due to the "to" string being right up against the end of memory. Found via valgrind testing (so we might've found it earlier, except that our regression tests lacked any exercise of translate()'s deletion feature). Fix by switching the order of the test-for-end-of-string and advance-pointer steps. While here, compute "to_ptr + tolen" just once. (Smarter compilers might figure that out for themselves, but let's just make sure.) Report and fix by Daniil Anisimov, in bug #17816. Discussion: https://postgr.es/m/17816-70f3d2764e88a108@postgresql.org Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/3b37e844220d4e7cedbb8def7fbcd2b36703d65d Modified Files -------------- src/backend/utils/adt/oracle_compat.c | 12 +++++++----- src/test/regress/expected/strings.out | 6 ++++++ src/test/regress/sql/strings.sql | 1 + 3 files changed, 14 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Avoid fetching one past the end of translate()'s "to" parameter. @ 2023-03-01 16:30 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2023-03-01 16:30 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid fetching one past the end of translate()'s "to" parameter. This is usually harmless, but if you were very unlucky it could provoke a segfault due to the "to" string being right up against the end of memory. Found via valgrind testing (so we might've found it earlier, except that our regression tests lacked any exercise of translate()'s deletion feature). Fix by switching the order of the test-for-end-of-string and advance-pointer steps. While here, compute "to_ptr + tolen" just once. (Smarter compilers might figure that out for themselves, but let's just make sure.) Report and fix by Daniil Anisimov, in bug #17816. Discussion: https://postgr.es/m/17816-70f3d2764e88a108@postgresql.org Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/b162660d3ac44688f18919cd460423022e467512 Modified Files -------------- src/backend/utils/adt/oracle_compat.c | 12 +++++++----- src/test/regress/expected/strings.out | 6 ++++++ src/test/regress/sql/strings.sql | 1 + 3 files changed, 14 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Avoid fetching one past the end of translate()'s "to" parameter. @ 2023-03-01 16:30 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 6+ messages in thread From: Tom Lane @ 2023-03-01 16:30 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid fetching one past the end of translate()'s "to" parameter. This is usually harmless, but if you were very unlucky it could provoke a segfault due to the "to" string being right up against the end of memory. Found via valgrind testing (so we might've found it earlier, except that our regression tests lacked any exercise of translate()'s deletion feature). Fix by switching the order of the test-for-end-of-string and advance-pointer steps. While here, compute "to_ptr + tolen" just once. (Smarter compilers might figure that out for themselves, but let's just make sure.) Report and fix by Daniil Anisimov, in bug #17816. Discussion: https://postgr.es/m/17816-70f3d2764e88a108@postgresql.org Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/b1a9d8ef254fab59c35a504490e14b2d9e1bbb92 Modified Files -------------- src/backend/utils/adt/oracle_compat.c | 12 +++++++----- src/test/regress/expected/strings.out | 6 ++++++ src/test/regress/sql/strings.sql | 1 + 3 files changed, 14 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2023-03-01 16:30 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2023-03-01 16:30 pgsql: Avoid fetching one past the end of translate()'s "to" parameter. Tom Lane <tgl@sss.pgh.pa.us> 2023-03-01 16:30 pgsql: Avoid fetching one past the end of translate()'s "to" parameter. Tom Lane <tgl@sss.pgh.pa.us> 2023-03-01 16:30 pgsql: Avoid fetching one past the end of translate()'s "to" parameter. Tom Lane <tgl@sss.pgh.pa.us> 2023-03-01 16:30 pgsql: Avoid fetching one past the end of translate()'s "to" parameter. Tom Lane <tgl@sss.pgh.pa.us> 2023-03-01 16:30 pgsql: Avoid fetching one past the end of translate()'s "to" parameter. Tom Lane <tgl@sss.pgh.pa.us> 2023-03-01 16:30 pgsql: Avoid fetching one past the end of translate()'s "to" parameter. 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