Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b031427

Browse files
committed
Issue #19437: Fix parse_envlist() of the posix/nt module, don't call
PyMapping_Values() with an exception set, exit immediatly on error.
1 parent b80b378 commit b031427

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Modules/posixmodule.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5083,8 +5083,10 @@ parse_envlist(PyObject* env, Py_ssize_t *envc_ptr)
50835083
}
50845084
envc = 0;
50855085
keys = PyMapping_Keys(env);
5086+
if (!keys)
5087+
goto error;
50865088
vals = PyMapping_Values(env);
5087-
if (!keys || !vals)
5089+
if (!vals)
50885090
goto error;
50895091
if (!PyList_Check(keys) || !PyList_Check(vals)) {
50905092
PyErr_Format(PyExc_TypeError,

0 commit comments

Comments
 (0)