diff options
author | Benjamin Peterson <benjamin@python.org> | 2016-01-21 22:02:46 -0800 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2016-01-21 22:02:46 -0800 |
commit | b1db7580611421309ab0be7c0801f4f89ecec440 (patch) | |
tree | f8231c9d7ef5102e9f9f49a819e48a7c0fe0a3ff | |
parent | 5d0124623c57f2f0ecdf181c8d79ab03710d7cde (diff) | |
download | cpython-git-b1db7580611421309ab0be7c0801f4f89ecec440.tar.gz |
reject negative data_size
-rw-r--r-- | Modules/zipimport.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/zipimport.c b/Modules/zipimport.c index 83fa8f9325..4594dd4f2f 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) { |