mirror of
https://github.com/python/cpython
synced 2024-09-16 03:29:57 +00:00
zipimport: catch _PyUnicode_AsString() failure in get_code_from_data()
It occurs if the path contains surrogates.
This commit is contained in:
parent
2c2bfe5bdf
commit
5a7913eb3b
|
@ -1119,6 +1119,10 @@ get_code_from_data(ZipImporter *self, int ispackage, int isbytecode,
|
|||
return NULL;
|
||||
|
||||
modpath = _PyUnicode_AsString(PyTuple_GetItem(toc_entry, 0));
|
||||
if (modpath == NULL) {
|
||||
Py_DECREF(data);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (isbytecode) {
|
||||
code = unmarshal_code(modpath, data, mtime);
|
||||
|
|
Loading…
Reference in a new issue