[issue4844] ZipFile doesn't range check in _EndRecData()

2013-01-31 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___

[issue4844] ZipFile doesn't range check in _EndRecData()

2013-01-31 Thread Roundup Robot
Roundup Robot added the comment: New changeset 32de35f0f877 by Serhiy Storchaka in branch '2.7': Issue #4844: ZipFile now raises BadZipfile when opens a ZIP file with an http://hg.python.org/cpython/rev/32de35f0f877 New changeset 01147e468c8c by Serhiy Storchaka in branch '3.2': Issue #4844: Zip

[issue4844] ZipFile doesn't range check in _EndRecData()

2013-01-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Patch updated. Now the test use io.BytesIO() for input too. A loop limit changed from len() -2 to len(). If there are no objections I'll commit this patch next week. -- assignee: mcherm -> serhiy.storchaka Added file: http://bugs.python.org/file28853

[issue4844] ZipFile doesn't range check in _EndRecData()

2013-01-26 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Removed file: http://bugs.python.org/file28178/zipfile_unpack_check.patch ___ Python tracker ___ ___ Python-bugs-

[issue4844] ZipFile doesn't range check in _EndRecData()

2012-12-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I just copy it from Alan's test. Actually this is not needed, `range(len(s))` can be used. -- ___ Python tracker ___ _

[issue4844] ZipFile doesn't range check in _EndRecData()

2012-12-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: In test_damaged_zipfile: +for N in range(len(s) - 2): +with open(TESTFN, "wb") as f: +f.write(s[:N]) why not `range(len(s))` instead? -- nosy: +pitrou ___ Python tracker

[issue4844] ZipFile doesn't range check in _EndRecData()

2012-12-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch for 3.4, which adds checks for other unpacks (except one, for which issue14315 exists). Also BadZipfile replaced by BadZipFile and trailing whitespaces deleted. For 2.7 BadZipFile should be replaced by BadZipfile back. -- stage: ->

[issue4844] ZipFile doesn't range check in _EndRecData()

2012-04-07 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue4844] ZipFile doesn't range check in _EndRecData()

2010-09-19 Thread Alan McIntyre
Alan McIntyre added the comment: I had to look up the abbreviation (Easier to Ask Forgiveness than Permission), but that does sound like a good idea. Thanks for mentioning it. :-) -- ___ Python tracker __

[issue4844] ZipFile doesn't range check in _EndRecData()

2010-09-19 Thread Charles-Francois Natali
Charles-Francois Natali added the comment: Following EAFP principle, it would be better - cleaner and more efficient - to put the stuct.unpack inside a try/except clause than checking the lengths beforehand. -- nosy: +neologix ___ Python tracker <

[issue4844] ZipFile doesn't range check in _EndRecData()

2010-08-21 Thread Alan McIntyre
Alan McIntyre added the comment: I wrote a test for this and tried out the patch on the Python3 trunk, and it seems to work ok. I've attached an updated patch that includes the test. It probably wouldn't hurt to go look for other places where a struct is being unpacked without checking lengt

[issue4844] ZipFile doesn't range check in _EndRecData()

2010-08-21 Thread Georg Brandl
Changes by Georg Brandl : -- assignee: -> mcherm nosy: +alanmcintyre, mcherm ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue4844] ZipFile doesn't range check in _EndRecData()

2009-01-05 Thread Guilherme Polo
Changes by Guilherme Polo : -- keywords: +patch Added file: http://bugs.python.org/file12603/issue4844.diff ___ Python tracker ___ ___

[issue4844] ZipFile doesn't range check in _EndRecData()

2009-01-05 Thread Yngve AAdlandsvik
Yngve AAdlandsvik added the comment: Here is the file. Note that this can be reproduced with any zip file if you delete the last byte of the file. Added file: http://bugs.python.org/file12597/64times01-double.zip ___ Python tracker

[issue4844] ZipFile doesn't range check in _EndRecData()

2009-01-05 Thread Lukas Lueg
Lukas Lueg added the comment: please attach 64times01-double.zip if possible -- nosy: +ebfe ___ Python tracker ___ ___ Python-bugs-lis

[issue4844] ZipFile doesn't range check in _EndRecData()

2009-01-05 Thread Yngve AAdlandsvik
New submission from Yngve AAdlandsvik : If you have a .zip file with an incomplete "End of Central Directory" record, _EndRecData() will throw a struct.error: D:\c64workdir\Ultimate_Mag_Archive>e:ziptest.py "old - Ultimate_Mag_Archive" Handling A-z\0\64times01-double.zip Traceback (most recent