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

Started by Tom Lane8 months ago1 messagescomitters
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

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: /messages/by-id/799984.1761150474@sss.pgh.pa.us
Backpatch-through: 13

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9f9a04368f8055c1851f5071add393b380d1cc52

Modified Files
--------------
src/backend/utils/mmgr/freepage.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)