From: Heikki Linnakangas Date: Mon, 5 Jan 2026 09:33:35 +0000 (+0200) Subject: Tighten up assertion on a local variable X-Git-Tag: REL_18_2~84 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b63302d900767cd0fdcb13c9cc53b538f4c04b78;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 255c43da856..6203e3d7f8d 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -1062,7 +1062,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));