reject negative data_size

This commit is contained in:
Benjamin Peterson 2016-01-21 22:02:46 -08:00
parent 9a3a8e9aa0
commit 5640bbb6c5
1 changed files with 4 additions and 0 deletions

View File

@ -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) {