Skip to content

Commit 0224638

Browse files
committed
reject negative data_size
1 parent 802c8a5 commit 0224638

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Modules/zipimport.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,6 +1071,10 @@ get_data(PyObject *archive, PyObject *toc_entry)
10711071
&date, &crc)) {
10721072
return NULL;
10731073
}
1074+
if (data_size < 0) {
1075+
PyErr_Format(ZipImportError, "negative data size");
1076+
return NULL;
1077+
}
10741078

10751079
fp = _Py_fopen_obj(archive, "rb");
10761080
if (!fp) {

0 commit comments

Comments
 (0)