Terry J. Reedy added the comment:

The bug was not noticing the length mismatch caused by a corrupt zip file.  It 
is already fixed.  The last link in your message opens 
https://hg.python.org/cpython/file/2.7/Lib/zipfile.py#l238.  A few lines 
further, the code now has an added guard.

        recData = data[start:start+sizeEndCentDir]
        if len(recData) != sizeEndCentDir:
            # Zip file is corrupted.
            return None
        endrec = list(struct.unpack(structEndArchive, recData))

When reporting a bug, please test on the currect release (ie, 2.7.11).  If this 
is not possible, and you have the specific traceback as here, one could look at 
the current code online.  Go to hg.python.org/cpython, select version in the 
sidebar, select 'Browse' in the sidebar, and then, in this case, /Lib and 
zipfile.py.

----------
nosy: +terry.reedy
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26319>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to