components/python/python34/patches/26-zipimport.patch
branchs11u3-sru
changeset 6185 0996b3bb223e
equal deleted inserted replaced
6180:a163ffb4ab14 6185:0996b3bb223e
       
     1 This patch comes from upstream:
       
     2 
       
     3 https://bugs.python.org/issue26171
       
     4 
       
     5 --- a/Modules/zipimport.c
       
     6 +++ b/Modules/zipimport.c
       
     7 @@ -1111,6 +1111,11 @@ get_data(PyObject *archive, PyObject *to
       
     8      }
       
     9      file_offset += l;           /* Start of file data */
       
    10  
       
    11 +    if (data_size > LONG_MAX - 1) {
       
    12 +        fclose(fp);
       
    13 +        PyErr_NoMemory();
       
    14 +        return NULL;
       
    15 +    }
       
    16      bytes_size = compress == 0 ? data_size : data_size + 1;
       
    17      if (bytes_size == 0)
       
    18          bytes_size++;