Skip to content

Commit

Permalink
Fix use-after-free in hashtableTwoPhasePopDelete
Browse files Browse the repository at this point in the history
Signed-off-by: Viktor Söderqvist <[email protected]>
  • Loading branch information
zuiderkwast committed Jan 27, 2025
1 parent a18fcdb commit 3daefd7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hashtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -1518,7 +1518,6 @@ void hashtableTwoPhasePopDelete(hashtable *ht, hashtablePosition *pos) {
assert(isPositionFilled(b, pos_in_bucket));
b->presence &= ~(1 << pos_in_bucket);
ht->used[table_index]--;
hashtableShrinkIfNeeded(ht);
hashtableResumeRehashing(ht);
if (b->chained && !hashtableIsRehashingPaused(ht)) {
/* Rehashing paused also means bucket chain compaction paused. It is
Expand All @@ -1527,6 +1526,7 @@ void hashtableTwoPhasePopDelete(hashtable *ht, hashtablePosition *pos) {
* we do the compaction in the scan and iterator code instead. */
fillBucketHole(ht, b, pos_in_bucket, table_index);
}
hashtableShrinkIfNeeded(ht);
}

/* Initializes the state for an incremental find operation.
Expand Down

0 comments on commit 3daefd7

Please sign in to comment.