[Python-checkins] cpython (3.4): reject negative data_size
benjamin.peterson
python-checkins at python.org
Fri Jan 22 01:04:11 EST 2016
https://hg.python.org/cpython/rev/8b58c9328f5c
changeset: 100035:8b58c9328f5c
branch: 3.4
parent: 100028:c75802aaa4de
user: Benjamin Peterson <benjamin at python.org>
date: Thu Jan 21 22:02:46 2016 -0800
summary:
reject negative data_size
files:
Modules/zipimport.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/Modules/zipimport.c b/Modules/zipimport.c
--- a/Modules/zipimport.c
+++ b/Modules/zipimport.c
@@ -1071,6 +1071,10 @@
&date, &crc)) {
return NULL;
}
+ if (data_size < 0) {
+ PyErr_Format(ZipImportError, "negative data size");
+ return NULL;
+ }
fp = _Py_fopen_obj(archive, "rb");
if (!fp) {
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list