diff options
| author | Neal Norwitz <nnorwitz@gmail.com> | 2006-08-12 03:17:41 +0000 |
|---|---|---|
| committer | Neal Norwitz <nnorwitz@gmail.com> | 2006-08-12 03:17:41 +0000 |
| commit | c10f063a52c1b2a0ecfba581c4a0b699c552b4ac (patch) | |
| tree | dccd4b35eb7aa1f53faf988e2e2bd214ac82c478 /Python/pythonrun.c | |
| parent | d6436cd4177d21b514185514fc9fef0ce7f5f8ff (diff) | |
| download | cpython-c10f063a52c1b2a0ecfba581c4a0b699c552b4ac.tar.gz | |
PyModule_GetDict() can fail, produce fatal errors if this happens on startup.
Klocwork #298-299.
Diffstat (limited to 'Python/pythonrun.c')
| -rw-r--r-- | Python/pythonrun.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 88fd67c1e5..37feeca3f3 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -203,12 +203,16 @@ Py_InitializeEx(int install_sigs) if (bimod == NULL) Py_FatalError("Py_Initialize: can't initialize __builtin__"); interp->builtins = PyModule_GetDict(bimod); + if (interp->builtins == NULL) + Py_FatalError("Py_Initialize: can't initialize builtins dict"); Py_INCREF(interp->builtins); sysmod = _PySys_Init(); if (sysmod == NULL) Py_FatalError("Py_Initialize: can't initialize sys"); interp->sysdict = PyModule_GetDict(sysmod); + if (interp->sysdict == NULL) + Py_FatalError("Py_Initialize: can't initialize sys dict"); Py_INCREF(interp->sysdict); _PyImport_FixupExtension("sys", "sys"); PySys_SetPath(Py_GetPath()); |
