[issue6434] buffer overflow in Zipfile when wrinting more than 2gig file

segfault42 report at bugs.python.org
Tue Jul 7 19:10:59 CEST 2009


New submission from segfault42 <brice.nahum at free.fr>:

Hello, 

I have a problem with the librairy zipfile.py
http://svn.python.org/view/python/trunk/Lib/zipfile.py?revision=73565&view=markup


Zinfo structure limit the size of a file to an int max value with the
ZIP64_LIMIT value ( equal to "(1 << 31) - 1 " so to 2147483647 . 

The problem is happening when you write a big file in the line 1095 : 

self.fp.write(struct.pack("<lLL", zinfo.CRC, zinfo.compress_size,
                 zinfo.file_size))

zinfo.file_size is limited to a int  size and if you have a file bigger
than ZIP64_LIMIT you make a buffer overflow even if you set the flag
allowZip64 to true.

----------
components: Library (Lib)
files: zipfile.py
messages: 90242
nosy: segfault42
severity: normal
status: open
title: buffer overflow in Zipfile when wrinting more than 2gig file
versions: Python 2.4, Python 3.0
Added file: http://bugs.python.org/file14469/zipfile.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6434>
_______________________________________


More information about the Python-bugs-list mailing list