23571894 problem in UTILITY/PYTHON s11u3-sru
authorJohn Beck <John.Beck@Oracle.COM>
Mon, 13 Jun 2016 14:14:56 -0700
branchs11u3-sru
changeset 6185 0996b3bb223e
parent 6180 a163ffb4ab14
child 6220 8e106512863d
23571894 problem in UTILITY/PYTHON
components/python/python27/patches/25-zipimport.patch
components/python/python34/patches/26-zipimport.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python27/patches/25-zipimport.patch	Mon Jun 13 14:14:56 2016 -0700
@@ -0,0 +1,18 @@
+This patch comes from upstream:
+
+https://bugs.python.org/issue26171
+
+--- a/Modules/zipimport.c
++++ b/Modules/zipimport.c
[email protected]@ -895,6 +895,11 @@ get_data(char *archive, PyObject *toc_en
+         PyMarshal_ReadShortFromFile(fp);        /* local header size */
+     file_offset += l;           /* Start of file data */
+ 
++    if (data_size > LONG_MAX - 1) {
++        fclose(fp);
++        PyErr_NoMemory();
++        return NULL;
++    }
+     raw_data = PyString_FromStringAndSize((char *)NULL, compress == 0 ?
+                                           data_size : data_size + 1);
+     if (raw_data == NULL) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/python/python34/patches/26-zipimport.patch	Mon Jun 13 14:14:56 2016 -0700
@@ -0,0 +1,18 @@
+This patch comes from upstream:
+
+https://bugs.python.org/issue26171
+
+--- a/Modules/zipimport.c
++++ b/Modules/zipimport.c
[email protected]@ -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++;