diff options
author | Thomas Munro <tmunro@postgresql.org> | 2023-09-26 09:07:26 +1300 |
---|---|---|
committer | Thomas Munro <tmunro@postgresql.org> | 2023-09-26 10:54:24 +1300 |
commit | 3d413c5a76fab4e374960ba6929545469c44aa13 (patch) | |
tree | d982396549e3df71db2233fba09bc5d4c37cc347 /src/backend/access/gist/gist.c | |
parent | 4dfb610822d5ab4bea7820da9be02d83bad69fb5 (diff) | |
download | postgresql-3d413c5a76fab4e374960ba6929545469c44aa13.tar.gz postgresql-3d413c5a76fab4e374960ba6929545469c44aa13.zip |
Fix edge-case for xl_tot_len broken by bae868ca.
bae868ca removed a check that was still needed. If you had an
xl_tot_len at the end of a page that was too small for a record header,
but not big enough to span onto the next page, we'd immediately perform
the CRC check using a bogus large length. Because of arbitrary coding
differences between the CRC implementations on different platforms,
nothing very bad happened on common modern systems. On systems using
the _sb8.c fallback we could segfault.
Restore that check, add a new assertion and supply a test for that case.
Back-patch to 12, like bae868ca.
Tested-by: Tom Lane <tgl@sss.pgh.pa.us>
Tested-by: Alexander Lakhin <exclusion@gmail.com>
Discussion: https://postgr.es/m/CA%2BhUKGLCkTT7zYjzOxuLGahBdQ%3DMcF%3Dz5ZvrjSOnW4EDhVjT-g%40mail.gmail.com
Diffstat (limited to 'src/backend/access/gist/gist.c')
0 files changed, 0 insertions, 0 deletions