commit | 5a7913eb3bf390a2f3fd28116fc789bf2c7e4b64 | [log] [tgz] |
---|---|---|
author | Victor Stinner <victor.stinner@haypocalc.com> | Sat Oct 16 11:29:07 2010 +0000 |
committer | Victor Stinner <victor.stinner@haypocalc.com> | Sat Oct 16 11:29:07 2010 +0000 |
tree | 3cfc1d6d0bff4130721955e91865d41a5770352a | |
parent | 2c2bfe5bdf63bf5f85131ff7a773e28c094b9550 [diff] [blame] |
zipimport: catch _PyUnicode_AsString() failure in get_code_from_data() It occurs if the path contains surrogates.
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 @@ 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);