Fix off-by-one Asserts in FreePageBtreeInsertInternal/Leaf.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: e7a3fae39e338c21b7c9ba8307775b410b4bd057
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2025-10-23T16:32:20Z
Releases: 18.1
Fix off-by-one Asserts in FreePageBtreeInsertInternal/Leaf.

These two functions expect there to be room to insert another item
in the FreePageBtree's array, but their assertions were too weak
to guarantee that.  This has little practical effect granting that
the callers are not buggy, but it seems to be misleading late-model
Coverity into complaining about possible array overrun.

Author: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/799984.1761150474@sss.pgh.pa.us
Backpatch-through: 13

Files

PathChange+/−
src/backend/utils/mmgr/freepage.c modified +4 −4

Discussion