Skip to content

Commit d3b2caa

Browse files
committed
fix: avoid using uninitialized memory
During a RUM index scan, if a concurrent VACUUM completes and removes all items from a posting tree leaf page, entry->nlist can become zero. In this case, entry->curItem may point to uninitialized memory, leading to a crash. The commit fixes this bug.
1 parent f557ab1 commit d3b2caa

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/rumget.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,9 @@ setListPositionScanEntry(RumState * rumstate, RumScanEntry entry)
498498
OffsetNumber StopLow = entry->offset,
499499
StopHigh = entry->nlist;
500500

501+
if (entry->nlist == 0)
502+
return true;
503+
501504
if (entry->useMarkAddInfo == false)
502505
{
503506
entry->offset = (ScanDirectionIsForward(entry->scanDirection)) ?

0 commit comments

Comments
 (0)