Content-Length: 255322 | pFad | http://github.com/postgrespro/postgres/commit/59cc2f58e6cd7bb247cb7b92eb460df0d06fab07

BC Fix off-by-one error in Assertion. · postgrespro/postgres@59cc2f5 · GitHub
Skip to content

Commit 59cc2f5

Browse files
committed
Fix off-by-one error in Assertion.
The point of the assertion is to ensure that the arrays allocated in stack are large enough, but the check was one item short. This won't matter in practice because MaxIndexTuplesPerPage is an overestimate, so you can't have that many items on a page in reality. But let's be tidy. Spotted by Anastasia Lubennikova. Backpatch to all supported versions, like the patch that added the assertion.
1 parent 850e1a5 commit 59cc2f5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/storage/page/bufpage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ PageIndexMultiDelete(Page page, OffsetNumber *itemnos, int nitems)
723723
int nextitm;
724724
OffsetNumber offnum;
725725

726-
Assert(nitems < MaxIndexTuplesPerPage);
726+
Assert(nitems <= MaxIndexTuplesPerPage);
727727

728728
/*
729729
* If there aren't very many items to delete, then retail

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/59cc2f58e6cd7bb247cb7b92eb460df0d06fab07

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy