From: Benjamin Peterson Date: Fri, 22 Jan 2016 06:02:46 +0000 (-0800) Subject: reject negative data_size X-Git-Tag: v3.4.5rc1~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1db7580611421309ab0be7c0801f4f89ecec440;p=thirdparty%2FPython%2Fcpython.git reject negative data_size --- diff --git a/Modules/zipimport.c b/Modules/zipimport.c index 83fa8f932598..4594dd4f2f54 100644 --- a/Modules/zipimport.c +++ b/Modules/zipimport.c @@ -1071,6 +1071,10 @@ get_data(PyObject *archive, PyObject *toc_entry) &date, &crc)) { return NULL; } + if (data_size < 0) { + PyErr_Format(ZipImportError, "negative data size"); + return NULL; + } fp = _Py_fopen_obj(archive, "rb"); if (!fp) {