Skip to content

Commit e66552c

Browse files
committed
Fix use-after-free when clearing interpreter's queue items
1 parent 4240c7d commit e66552c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Modules/_interpqueuesmodule.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,9 @@ _queue_clear_interpreter(_queue *queue, int64_t interpid)
763763
else {
764764
prev->next = next;
765765
}
766+
if (next == NULL) {
767+
queue->items.last = prev;
768+
}
766769
queue->items.count -= 1;
767770
}
768771
else {

0 commit comments

Comments
 (0)