]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #19437: Fix parse_envlist() of the posix/nt module, don't call
authorVictor Stinner <victor.stinner@gmail.com>
Thu, 14 Nov 2013 20:37:05 +0000 (21:37 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Thu, 14 Nov 2013 20:37:05 +0000 (21:37 +0100)
PyMapping_Values() with an exception set, exit immediatly on error.

Modules/posixmodule.c

index 5e5f35520caceda1e44d558513a2088abf4701f8..7e6bdc8879e353ed96effec2003538fae234083b 100644 (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,