Kaydet (Commit) 000fde96 authored tarafından Stefan Krah's avatar Stefan Krah

Closes #15737: Fix potential NULL dereference in zipimport.c.

üst 6adf2433
......@@ -947,8 +947,6 @@ read_directory(PyObject *archive)
else
charset = "cp437";
nameobj = PyUnicode_Decode(name, name_size, charset, NULL);
if (PyUnicode_READY(nameobj) == -1)
goto error;
if (nameobj == NULL) {
if (bootstrap)
PyErr_Format(PyExc_NotImplementedError,
......@@ -957,6 +955,8 @@ read_directory(PyObject *archive)
PY_MAJOR_VERSION, PY_MINOR_VERSION);
goto error;
}
if (PyUnicode_READY(nameobj) == -1)
goto error;
path = PyUnicode_FromFormat("%U%c%U", archive, SEP, nameobj);
if (path == NULL)
goto error;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment