[Python-checkins] r85568 - python/branches/py3k/Modules/zipimport.c

victor.stinner python-checkins at python.org
Sat Oct 16 13:29:08 CEST 2010


Author: victor.stinner
Date: Sat Oct 16 13:29:07 2010
New Revision: 85568

Log:
zipimport: catch _PyUnicode_AsString() failure in get_code_from_data()

It occurs if the path contains surrogates.


Modified:
   python/branches/py3k/Modules/zipimport.c

Modified: python/branches/py3k/Modules/zipimport.c
==============================================================================
--- python/branches/py3k/Modules/zipimport.c	(original)
+++ python/branches/py3k/Modules/zipimport.c	Sat Oct 16 13:29:07 2010
@@ -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);


More information about the Python-checkins mailing list