Line 0
Link Here
|
|
|
1 |
--- Modules/zipimport.c.orig 2015-12-05 19:47:16 UTC |
2 |
+++ Modules/zipimport.c |
3 |
@@ -895,6 +895,11 @@ get_data(char *archive, PyObject *toc_en |
4 |
PyMarshal_ReadShortFromFile(fp); /* local header size */ |
5 |
file_offset += l; /* Start of file data */ |
6 |
|
7 |
+ if (data_size > LONG_MAX - 1) { |
8 |
+ fclose(fp); |
9 |
+ PyErr_NoMemory(); |
10 |
+ return NULL; |
11 |
+ } |
12 |
raw_data = PyString_FromStringAndSize((char *)NULL, compress == 0 ? |
13 |
data_size : data_size + 1); |
14 |
if (raw_data == NULL) { |