From: Konstantin Knizhnik <knizhnik@garret.ru>
To: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
To: Peter Geoghegan <pg@bowt.ie>
Subject: Bug in heap_get_root_tuples
Date: Wed, 15 Jul 2026 16:37:16 +0300
Message-ID: <87c7d8a4-3a82-4334-bee6-e8c2ad3f3293@garret.ru> (raw)
Commit c7aeb775df895db240dcd6f47242f7e08899adfb contains the following
change:
- /* Sanity check */
- if (nextoffnum < FirstOffsetNumber || nextoffnum
> maxoff)
+ /* Sanity check (pure paranoia) */
+ if (offnum < FirstOffsetNumber)
+ break;
+
+ /*
+ * An offset past the end of page's line pointer
array is possible
+ * when the array was truncated
+ */
+ if (offnum > maxoff)
break;
lp = PageGetItemId(page, nextoffnum);
So it checks `offnum` and uses `nextoffnum`.
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-bugs@postgresql.org
Cc: knizhnik@garret.ru, pgsql-bugs@lists.postgresql.org, pg@bowt.ie
Subject: Re: Bug in heap_get_root_tuples
In-Reply-To: <87c7d8a4-3a82-4334-bee6-e8c2ad3f3293@garret.ru>
* 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