summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2016-01-22 06:03:55 (GMT)
committerBenjamin Peterson <benjamin@python.org>2016-01-22 06:03:55 (GMT)
commitd52513cb222174df834ea81e61037899248e312c (patch)
tree69e17e0610bb37792f7d6522dd848355f58b9d7e
parente5c05cc8c0c4bdf9748f8d7d2a39e85793e52af9 (diff)
parentb1db7580611421309ab0be7c0801f4f89ecec440 (diff)
downloadcpython-d52513cb222174df834ea81e61037899248e312c.zip
cpython-d52513cb222174df834ea81e61037899248e312c.tar.gz
cpython-d52513cb222174df834ea81e61037899248e312c.tar.bz2
merge 3.4
-rw-r--r--Modules/zipimport.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/zipimport.c b/Modules/zipimport.c
index fa60aa9..48a0f26 100644
--- a/Modules/zipimport.c
+++ b/Modules/zipimport.c
@@ -1091,6 +1091,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)