From: Christian Heimes Date: Thu, 8 Sep 2016 22:22:28 +0000 (+0200) Subject: Fix potential NULL pointer dereference in update_symbols() X-Git-Tag: v3.6.0b1~235 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=45af0c83da093ac8f6756d98c36e064e7c01b19b;p=thirdparty%2FPython%2Fcpython.git 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() --- diff --git a/Python/symtable.c b/Python/symtable.c index 3f03184f088a..45a8c2c64bd9 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 */ }