commit | 5640bbb6c5c0c9232fd761ef4544687f9123e43e | [log] [tgz] |
---|---|---|
author | Benjamin Peterson <benjamin@python.org> | Thu Jan 21 22:02:46 2016 -0800 |
committer | Benjamin Peterson <benjamin@python.org> | Thu Jan 21 22:02:46 2016 -0800 |
tree | 3f09436fb76a5a5e254276f64d46917dd350c6da | |
parent | 9a3a8e9aa022f201af4bf33f4b8afe6ba2099aec [diff] [blame] |
reject negative data_size
diff --git a/Modules/zipimport.c b/Modules/zipimport.c index 006be3c..be9753f 100644 --- a/Modules/zipimport.c +++ b/Modules/zipimport.c
@@ -861,6 +861,10 @@ &date, &crc)) { return NULL; } + if (data_size < 0) { + PyErr_Format(ZipImportError, "negative data size"); + return NULL; + } fp = fopen(archive, "rb"); if (!fp) {