From 45af0c83da093ac8f6756d98c36e064e7c01b19b Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Fri, 9 Sep 2016 00:22:28 +0200 Subject: [PATCH] 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() --- Python/symtable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/symtable.c b/Python/symtable.c index 3f03184f088..45a8c2c64bd 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -652,7 +652,7 @@ update_symbols(PyObject *symbols, PyObject *scopes, continue; } /* Handle global symbol */ - if (!PySet_Contains(bound, name)) { + if (bound && !PySet_Contains(bound, name)) { Py_DECREF(name); continue; /* it's a global */ }