1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-20 05:13:53 +03:00
Thomas Munro 45d1fe8b53 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
2023-09-26 10:54:47 +13:00
..
2020-01-01 12:21:45 -05:00
2022-07-11 15:48:54 +12:00
2023-08-07 12:30:06 +02:00
2023-06-16 10:19:44 +09:00
2018-03-30 17:33:04 -07:00
2020-01-01 12:21:45 -05:00
2020-09-14 13:14:53 +02:00