mirror of https://github.com/python/cpython
Closes #15737: Fix potential NULL dereference in zipimport.c.
This commit is contained in:
parent
6adf2433e4
commit
000fde9651
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue