(original) (raw)

--- zipfile_orig.py 2010-12-14 10:23:58.000000000 -0500 +++ zipfile.py 2010-12-14 10:30:21.000000000 -0500 @@ -228,6 +228,13 @@ # structure present, so go look for it return _EndRecData64(fpin, start - filesize, endrec) return endrec + else : + # be robust to non-comment extaneous data after endrec + # by making it a comment so that nothing is ever lost + endrec[_ECD_COMMENT_SIZE] = len(comment) + endrec.append(comment) + endrec.append(maxCommentStart + start) + return endrec # Unable to find a valid end of central directory structure return