Index: Lib/zipfile.py =================================================================== --- Lib/zipfile.py (revision 68230) +++ Lib/zipfile.py (working copy) @@ -228,6 +228,9 @@ if start >= 0: # found the magic number; attempt to unpack and interpret recData = data[start:start+sizeEndCentDir] + if len(recData) != sizeEndCentDir: + # Zip file is corrupted. + return endrec = list(struct.unpack(structEndArchive, recData)) comment = data[start+sizeEndCentDir:] # check that comment length is correct