Skip to content

Commit 45af0c8

Browse files
committed
Fix potential NULL pointer dereference in update_symbols()
symtable_analyze() calls analyze_block() with bound=NULL. Theoretically that NULL can be passed down to update_symbols(). update_symbols() may deference NULL and pass it to PySet_Contains()
1 parent bb0b0d9 commit 45af0c8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Python/symtable.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ update_symbols(PyObject *symbols, PyObject *scopes,
652652
continue;
653653
}
654654
/* Handle global symbol */
655-
if (!PySet_Contains(bound, name)) {
655+
if (bound && !PySet_Contains(bound, name)) {
656656
Py_DECREF(name);
657657
continue; /* it's a global */
658658
}

0 commit comments

Comments
 (0)