reject negative data_size

This commit is contained in:
Benjamin Peterson 2016-01-21 22:02:46 -08:00
parent 5d0124623c
commit b1db758061

View file

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