From: Benjamin Peterson Date: Fri, 22 Jan 2016 06:03:55 +0000 (-0800) Subject: merge 3.4 X-Git-Tag: v3.6.0a1~718^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d52513cb222174df834ea81e61037899248e312c;p=thirdparty%2FPython%2Fcpython.git merge 3.4 --- d52513cb222174df834ea81e61037899248e312c diff --cc Modules/zipimport.c index fa60aa9e0a5b,4594dd4f2f54..48a0f26f53d4 --- a/Modules/zipimport.c +++ b/Modules/zipimport.c @@@ -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) {