Message149109
I grabbed a 2.7.2 zipfile.py, and my original comments stand. If there is a "garbage at end of file" patch, I can't find it; please provide a line number or a hint. The user at yale.edu reports that the patch works. Here is a diff of my changes. To test, append some junk to a good zipfile: echo junk >> good.zip, and try reading it. Let me know if you want me to do anything else; maybe look at 3.2; or email me offline.
*** zipfile.py 2011-12-09 11:25:07.000000000 -0500
--- ../zipfile.py 2011-12-09 05:48:00.000000000 -0500
***************
*** 237,248 ****
recData = data[start:start+sizeEndCentDir]
endrec = list(struct.unpack(structEndArchive, recData))
comment = data[start+sizeEndCentDir:]
! ## Remove # check that comment length is correct
! ## Remove if endrec[_ECD_COMMENT_SIZE] == len(comment):
! # check that the offset to the Central Directory points to a valid item
! fpin.seek(endrec[_ECD_OFFSET], 0)
! dat = fpin.read(4)
! if dat == stringCentralDir:
# Append the archive comment and start offset
endrec.append(comment)
endrec.append(maxCommentStart + start) |
|
Date |
User |
Action |
Args |
2011-12-09 17:11:09 | ahlstromjc | set | recipients:
+ ahlstromjc, georg.brandl, alanmcintyre, arkanes, markhirota, r.david.murray, flox, Ernst.Sjöstrand, antitree |
2011-12-09 17:11:07 | ahlstromjc | set | messageid: <1323450667.55.0.103263455755.issue1757072@psf.upfronthosting.co.za> |
2011-12-09 17:11:06 | ahlstromjc | link | issue1757072 messages |
2011-12-09 17:11:06 | ahlstromjc | create | |
|