diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-11-14 20:37:05 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-11-14 20:37:05 (GMT) |
commit | b03142782c84c3ce6ba0a86a3af93c08b84f32e6 (patch) | |
tree | 458973cf0a6584e84805d95adc44dca3bbfa01cf | |
parent | b80b37868069fc5ff459f41565163c417fa3cf12 (diff) | |
download | cpython-b03142782c84c3ce6ba0a86a3af93c08b84f32e6.zip cpython-b03142782c84c3ce6ba0a86a3af93c08b84f32e6.tar.gz cpython-b03142782c84c3ce6ba0a86a3af93c08b84f32e6.tar.bz2 |
Issue #19437: Fix parse_envlist() of the posix/nt module, don't call
PyMapping_Values() with an exception set, exit immediatly on error.
-rw-r--r-- | Modules/posixmodule.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 5e5f355..7e6bdc8 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -5083,8 +5083,10 @@ parse_envlist(PyObject* env, Py_ssize_t *envc_ptr) } envc = 0; keys = PyMapping_Keys(env); + if (!keys) + goto error; vals = PyMapping_Values(env); - if (!keys || !vals) + if (!vals) goto error; if (!PyList_Check(keys) || !PyList_Check(vals)) { PyErr_Format(PyExc_TypeError, |