mirror of
https://github.com/python/cpython.git
synced 2025-11-02 19:12:55 +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;
|
return NULL;
|
||||||
|
|
||||||
modpath = _PyUnicode_AsString(PyTuple_GetItem(toc_entry, 0));
|
modpath = _PyUnicode_AsString(PyTuple_GetItem(toc_entry, 0));
|
||||||
|
if (modpath == NULL) {
|
||||||
|
Py_DECREF(data);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (isbytecode) {
|
if (isbytecode) {
|
||||||
code = unmarshal_code(modpath, data, mtime);
|
code = unmarshal_code(modpath, data, mtime);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue