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

From Tom Lane
Subject pgsql: Fix off-by-one Asserts in FreePageBtreeInsertInternal/Leaf.
Date
Msg-id E1vByFa-00398H-38@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/dc0a208ac2e9435418a0660e5b42c52fd72284bb

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


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Fix resource leaks in PL/Python error reporting, redux.
Next
From: Tom Lane
Date:
Subject: pgsql: Avoid memory leak in validation of a PL/Python trigger function.