summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-10-05 22:17:41 (GMT)
committerGuido van Rossum <guido@python.org>1999-10-05 22:17:41 (GMT)
commitbe2033697f8b9b44656965888d0533bf6d0a8499 (patch)
tree487d39cb6f51574176800c20993dc586f74f6bca /Python/sysmodule.c
parentcaf2f8e3c71cad510852939d425581acbff6317b (diff)
downloadcpython-be2033697f8b9b44656965888d0533bf6d0a8499.zip
cpython-be2033697f8b9b44656965888d0533bf6d0a8499.tar.gz
cpython-be2033697f8b9b44656965888d0533bf6d0a8499.tar.bz2
In PySys_GetObject(), it's possible that tstate->interp->sysdict is
NULL. In that case, return NULL rather than dumping core. This fixes PR#91, submitted by Lele Gaifax.
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 5a066a5..a7a5933 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -64,6 +64,8 @@ PySys_GetObject(name)
{
PyThreadState *tstate = PyThreadState_Get();
PyObject *sd = tstate->interp->sysdict;
+ if (sd == NULL)
+ return NULL;
return PyDict_GetItemString(sd, name);
}