aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeAgg.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2023-03-01 11:30:17 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2023-03-01 11:30:31 -0500
commitd7056bc1c71d2d876adb60dda8e0ba962e8279df (patch)
tree65552305c23835b4e7de090cbb3b457f176c7770 /src/backend/executor/nodeAgg.c
parent6095069b40d7f01d5e7771d23b18d65dc029fc0d (diff)
downloadpostgresql-d7056bc1c71d2d876adb60dda8e0ba962e8279df.tar.gz
postgresql-d7056bc1c71d2d876adb60dda8e0ba962e8279df.zip
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
Diffstat (limited to 'src/backend/executor/nodeAgg.c')
0 files changed, 0 insertions, 0 deletions