diff options
author | Guido van Rossum <guido@python.org> | 1999-10-05 22:17:41 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1999-10-05 22:17:41 (GMT) |
commit | be2033697f8b9b44656965888d0533bf6d0a8499 (patch) | |
tree | 487d39cb6f51574176800c20993dc586f74f6bca /Python | |
parent | caf2f8e3c71cad510852939d425581acbff6317b (diff) | |
download | cpython-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')
-rw-r--r-- | Python/sysmodule.c | 2 |
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); } |