diff options
author | Christian Heimes <christian@cheimes.de> | 2013-07-20 20:54:25 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2013-07-20 20:54:25 (GMT) |
commit | a6404ad43c11d04909a9e01f85559e1b52e616b4 (patch) | |
tree | 68dbe8091038760ebbb1f99f882ec2e6d9430c6c /Modules/pyexpat.c | |
parent | 09994a9c595b35e0ee99e69172abf8b8a1ff7994 (diff) | |
download | cpython-a6404ad43c11d04909a9e01f85559e1b52e616b4.zip cpython-a6404ad43c11d04909a9e01f85559e1b52e616b4.tar.gz cpython-a6404ad43c11d04909a9e01f85559e1b52e616b4.tar.bz2 |
Check return value of PyEval_GetGlobals() for NULL
CID 486814
Diffstat (limited to 'Modules/pyexpat.c')
-rw-r--r-- | Modules/pyexpat.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c index 07b1348d..7e51d35 100644 --- a/Modules/pyexpat.c +++ b/Modules/pyexpat.c @@ -283,12 +283,17 @@ call_with_frame(PyCodeObject *c, PyObject* func, PyObject* args, { PyThreadState *tstate = PyThreadState_GET(); PyFrameObject *f; - PyObject *res; + PyObject *res, *globals; if (c == NULL) return NULL; - f = PyFrame_New(tstate, c, PyEval_GetGlobals(), NULL); + globals = PyEval_GetGlobals(); + if (globals == NULL) { + return NULL; + } + + f = PyFrame_New(tstate, c, globals, NULL); if (f == NULL) return NULL; tstate->frame = f; |