postgresql/src
Thomas Munro bde2f1847f 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:59:49 +13:00
..
backend Fix edge-case for xl_tot_len broken by bae868ca. 2023-09-26 10:59:49 +13:00
bin pg_dump: tests: Correct test condition for invalid databases 2023-09-25 12:10:46 -07:00
common Make EXEC_BACKEND more convenient on Linux and FreeBSD. 2023-02-08 13:09:52 +09:00
fe_utils Clean up assorted failures under clang's -fsanitize=undefined checks. 2022-03-03 18:13:24 -05:00
include Avoid unnecessary plancache revalidation of utility statements. 2023-08-24 12:02:40 -04:00
interfaces Stamp 12.16. 2023-08-07 16:13:41 -04:00
makefiles Select CFLAGS_SL at configure time, not in platform-specific Makefiles. 2019-10-21 12:32:35 -04:00
pl Collect dependency information for parsed CallStmts. 2023-09-25 14:41:57 -04:00
port Stamp 12.16. 2023-08-07 16:13:41 -04:00
template On NetBSD, force dynamic symbol resolution at postmaster start. 2022-08-30 17:29:13 -04:00
test Fix edge-case for xl_tot_len broken by bae868ca. 2023-09-26 10:59:49 +13:00
timezone Update time zone data files to tzdata release 2023c. 2023-04-18 14:46:39 -04:00
tools Fix exception safety bug in typcache.c. 2023-09-13 14:50:14 +12:00
tutorial Doc: sync src/tutorial/basics.source with SGML documentation. 2022-11-19 13:09:14 -05:00
.gitignore
DEVELOPERS
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in Fix prove_installcheck when used with PGXS 2023-05-05 07:12:18 +02:00
Makefile.shlib Fix pkg-config files for static linking 2021-09-06 09:43:18 +02:00
nls-global.mk NLS: Fix backend gettext triggers 2019-09-23 09:05:50 +02:00