diff -r 355af3657df3 Modules/zipimport.c --- a/Modules/zipimport.c Wed Dec 04 09:43:21 2013 +0100 +++ b/Modules/zipimport.c Wed Dec 04 10:30:16 2013 +0100 @@ -903,13 +903,19 @@ arc_offset = header_position - header_offset - header_size; header_offset += arc_offset; + if (header_offset > LONG_MAX) { + fclose(fp); + PyErr_Format(ZipImportError, "can't read Zip file: %R", archive); + return NULL; + } + files = PyDict_New(); if (files == NULL) goto error; /* Start of Central Directory */ count = 0; - if (fseek(fp, header_offset, 0) == -1) + if (fseek(fp, (long)header_offset, 0) == -1) goto file_error; for (;;) { PyObject *t;