diff options
author | Benjamin Peterson <benjamin@python.org> | 2016-01-22 06:02:46 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2016-01-22 06:02:46 (GMT) |
commit | 5640bbb6c5c0c9232fd761ef4544687f9123e43e (patch) | |
tree | 3f09436fb76a5a5e254276f64d46917dd350c6da /Modules | |
parent | 9a3a8e9aa022f201af4bf33f4b8afe6ba2099aec (diff) | |
download | cpython-5640bbb6c5c0c9232fd761ef4544687f9123e43e.zip cpython-5640bbb6c5c0c9232fd761ef4544687f9123e43e.tar.gz cpython-5640bbb6c5c0c9232fd761ef4544687f9123e43e.tar.bz2 |
reject negative data_size
Diffstat (limited to 'Modules')
-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 006be3c..be9753f 100644 --- a/Modules/zipimport.c +++ b/Modules/zipimport.c @@ -861,6 +861,10 @@ get_data(char *archive, PyObject *toc_entry) &date, &crc)) { return NULL; } + if (data_size < 0) { + PyErr_Format(ZipImportError, "negative data size"); + return NULL; + } fp = fopen(archive, "rb"); if (!fp) { |