]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
merge 3.4
authorBenjamin Peterson <benjamin@python.org>
Fri, 22 Jan 2016 06:03:55 +0000 (22:03 -0800)
committerBenjamin Peterson <benjamin@python.org>
Fri, 22 Jan 2016 06:03:55 +0000 (22:03 -0800)
1  2 
Modules/zipimport.c

index fa60aa9e0a5b9577facf4e162945d3dfaf6a7697,4594dd4f2f542d92e6d501b43241e8c684fd7944..48a0f26f53d446bafd9b884863b265295557804c
@@@ -1091,10 -1071,18 +1091,14 @@@ get_data(PyObject *archive, PyObject *t
                            &date, &crc)) {
          return NULL;
      }
+     if (data_size < 0) {
+         PyErr_Format(ZipImportError, "negative data size");
+         return NULL;
+     }
  
      fp = _Py_fopen_obj(archive, "rb");
 -    if (!fp) {
 -        if (!PyErr_Occurred())
 -            PyErr_Format(PyExc_IOError,
 -               "zipimport: can not open file %U", archive);
 +    if (!fp)
          return NULL;
 -    }
  
      /* Check to make sure the local file header is correct */
      if (fseek(fp, file_offset, 0) == -1) {