Issue #19437: Fix parse_envlist() of the posix/nt module, don't call

PyMapping_Values() with an exception set, exit immediatly on error.
This commit is contained in:
Victor Stinner 2013-11-14 21:37:05 +01:00
parent b80b378680
commit b03142782c
1 changed files with 3 additions and 1 deletions

View File

@ -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,