mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +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
1 changed files with 4 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue