Bug in heap_get_root_tuples - Mailing list pgsql-bugs

From Konstantin Knizhnik
Subject Bug in heap_get_root_tuples
Date
Msg-id 87c7d8a4-3a82-4334-bee6-e8c2ad3f3293@garret.ru
Whole thread
Responses Re: Bug in heap_get_root_tuples
List pgsql-bugs
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`.




pgsql-bugs by date:

Previous
From: Maaz Syed Adeeb
Date:
Subject: CREATE INDEX with an expression in an INCLUDE column fails with XX000 "unrecognized node type" instead of 0A000 on master
Next
From: Fujii Masao
Date:
Subject: Re: BUG #19547: libpqrcv_create_slot dereferences NULL on a malformed CREATE_REPLICATION_SLOT reply