diff options
author | Guido van Rossum <guido@python.org> | 1999-10-05 22:17:41 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1999-10-05 22:17:41 +0000 |
commit | f8758dc2ad1c10e62028744f0f7c592a269f1de6 (patch) | |
tree | 7d4dc0d8c3ade8e894e59ad2ce2fb0cb708d7de7 /Python/sysmodule.c | |
parent | c71cb94595b7e5bc508de02da432a5286dc8b504 (diff) | |
download | cpython-f8758dc2ad1c10e62028744f0f7c592a269f1de6.tar.gz |
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.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 5a066a5997..a7a59333ee 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); } |