From: Victor Stinner Date: Thu, 14 Nov 2013 20:37:05 +0000 (+0100) Subject: Issue #19437: Fix parse_envlist() of the posix/nt module, don't call X-Git-Tag: v3.4.0b1~276 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b03142782c84c3ce6ba0a86a3af93c08b84f32e6;p=thirdparty%2FPython%2Fcpython.git Issue #19437: Fix parse_envlist() of the posix/nt module, don't call PyMapping_Values() with an exception set, exit immediatly on error. --- diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 5e5f35520cac..7e6bdc8879e3 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,