summaryrefslogtreecommitdiffstats
path: root/Python/symtable.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2016-09-08 22:22:28 (GMT)
committerChristian Heimes <christian@python.org>2016-09-08 22:22:28 (GMT)
commit45af0c83da093ac8f6756d98c36e064e7c01b19b (patch)
treed0a7f44d22680fd5dc774f931db5bcef38809a34 /Python/symtable.c
parentbb0b0d9ff0c8521ce0e96006ce5382f09ac07c33 (diff)
downloadcpython-45af0c83da093ac8f6756d98c36e064e7c01b19b.zip
cpython-45af0c83da093ac8f6756d98c36e064e7c01b19b.tar.gz
cpython-45af0c83da093ac8f6756d98c36e064e7c01b19b.tar.bz2
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()
Diffstat (limited to 'Python/symtable.c')
-rw-r--r--Python/symtable.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/symtable.c b/Python/symtable.c
index 3f03184..45a8c2c 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 */
}