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

Paul report at bugs.python.org
Thu Oct 27 18:47:49 CEST 2011


Paul <paul.bauer.spearstone at gmail.com> added the comment:

This is a problem with python2.7 as well.  A change in struct between python2.6 and 2.7 raises an exception on overflow instead of silently allowing it.  This prevents zipping any file larger than 4.5G.  This exception concurs when writing the 32-bit headers (which are not used on large files anyway)

The patch should be simple.  Just wrap line 1100: 
...struct.pack("<LLL",...
with a try: except: to revert to the old behavior.   Alternatively, check if size is bigger than ZIP64_LIMIT and set to anything less than ZIP64_LIMIT.

----------
nosy: +Paul
versions: +Python 2.7

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


More information about the Python-bugs-list mailing list