pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix off-by-one Asserts in FreePageBtreeInsertInternal/Leaf.
Date: Thu, 23 Oct 2025 16:33:18 +0000
Message-ID: <E1vByFa-003982-2p@gemulon.postgresql.org> (raw)

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
------
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(-)



view thread (7+ messages)  latest in thread

Message-ID: <E1vByFa-003982-2p@gemulon.postgresql.org>
Permalink:  ../E1vByFa-003982-2p@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vByFa-003982-2p@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix off-by-one Asserts in FreePageBtreeInsertInternal/Leaf.
  In-Reply-To: <E1vByFa-003982-2p@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox