Fix off-by-one Asserts in FreePageBtreeInsertInternal/Leaf.
authorTom Lane <[email protected]>
Thu, 23 Oct 2025 16:32:06 +0000 (12:32 -0400)
committerTom Lane <[email protected]>
Thu, 23 Oct 2025 16:32:26 +0000 (12:32 -0400)
commit39d24475c18059a2fe1de1d05352fd5eed6092b3
tree182fa01433f76ee80beda7289f18a440d5a7baac
parentfbc41a145ae00166b8cdd22c236566e76864732c
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 <[email protected]>
Discussion: https://postgr.es/m/799984.1761150474@sss.pgh.pa.us
Backpatch-through: 13
src/backend/utils/mmgr/freepage.c