summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2016-01-22 06:02:46 (GMT)
committerBenjamin Peterson <benjamin@python.org>2016-01-22 06:02:46 (GMT)
commitb1db7580611421309ab0be7c0801f4f89ecec440 (patch)
treef8231c9d7ef5102e9f9f49a819e48a7c0fe0a3ff /Modules
parent5d0124623c57f2f0ecdf181c8d79ab03710d7cde (diff)
downloadcpython-b1db7580611421309ab0be7c0801f4f89ecec440.zip
cpython-b1db7580611421309ab0be7c0801f4f89ecec440.tar.gz
cpython-b1db7580611421309ab0be7c0801f4f89ecec440.tar.bz2
reject negative data_size
Diffstat (limited to 'Modules')
-rw-r--r--Modules/zipimport.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/zipimport.c b/Modules/zipimport.c
index 83fa8f9..4594dd4 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) {