components/python/python34/patches/26-zipimport.patch
author pkidd <patrick.kidd@oracle.com>
Fri, 24 Feb 2017 07:31:04 -0800
branchs11u3-sru
changeset 7693 789db572fc03
parent 6185 0996b3bb223e
permissions -rw-r--r--
build metadata for S11.3SRU18.3

This patch comes from upstream:

https://bugs.python.org/issue26171

--- a/Modules/zipimport.c
+++ b/Modules/zipimport.c
@@ -1111,6 +1111,11 @@ get_data(PyObject *archive, PyObject *to
     }
     file_offset += l;           /* Start of file data */
 
+    if (data_size > LONG_MAX - 1) {
+        fclose(fp);
+        PyErr_NoMemory();
+        return NULL;
+    }
     bytes_size = compress == 0 ? data_size : data_size + 1;
     if (bytes_size == 0)
         bytes_size++;