From: Heikki Linnakangas Date: Mon, 5 Jan 2026 09:33:35 +0000 (+0200) Subject: Tighten up assertion on a local variable X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=461b8cc95252ff0177a44be20b06c21ff07af4fa;p=thirdparty%2Fpostgresql.git Tighten up assertion on a local variable 'lineindex' is 0-based, as mentioned in the comments. Backpatch to v18 where the assertion was added. Author: ChangAo Chen Reviewed-by: Chao Li Discussion: https://www.postgresql.org/message-id/tencent_A84F3C810365BB9BD08442955AE494141907@qq.com Backpatch-through: 18 --- diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c index a555b7b2508..ad9d6338ec2 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -1077,7 +1077,7 @@ continue_page: ItemId lpp; OffsetNumber lineoff; - Assert(lineindex <= scan->rs_ntuples); + Assert(lineindex < scan->rs_ntuples); lineoff = scan->rs_vistuples[lineindex]; lpp = PageGetItemId(page, lineoff); Assert(ItemIdIsNormal(lpp));