diff options
-rw-r--r-- | Modules/zipimport.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/zipimport.c b/Modules/zipimport.c index d1c939f..efe6972 100644 --- a/Modules/zipimport.c +++ b/Modules/zipimport.c @@ -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); |