[issue10298] zipfile: incorrect comment size will prevent extracting
New submission from rep : Opening (and thus extracting) zip files with appended junk data is not possible with the way the current zipfile implementation checks validity. Basically the problem comes down to the comment size in the end-of-central-directory record being different from the size of the data following that record. Unix unzip and similar utilities handle that case by looking at the eocd-record and taking that as the correct value. Zip files with data appended to them will be extracted just fine with these tools. In python's zipfile the _EndRecData function will return None if the comment size does not match the record's value. The patch modifies this behaviour and takes only the portion of trailing data that the record specifies and due to that it does not raise BadZipfile exceptions if there's any junk data appended to a zip file. -- components: Library (Lib) files: zipfile_recover_commentsize.patch keywords: patch messages: 120326 nosy: rep priority: normal severity: normal status: open title: zipfile: incorrect comment size will prevent extracting type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file19477/zipfile_recover_commentsize.patch ___ Python tracker <http://bugs.python.org/issue10298> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10694] zipfile.py end of central directory detection not robust
rep added the comment: Xuanji: Patch looks good now with the test cases. Regarding the other fix suggested by Kevin I think that we should not introduce custom behaviour here like appending the eofdata to the comment even though the comment size in the record does not say so. In the end we want to make sure that correct zip files end up being processed correctly with the specified comment size and incorrect zip files with eofdata should not be rejected / throw exceptions. So I agree with Xuanji that his patch (or mine) is the way to go. You probably agree that we can mark issue 10298 to be superseded by this one here. -- ___ Python tracker <http://bugs.python.org/issue10694> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10298] zipfile: incorrect comment size will prevent extracting
Changes by rep : -- status: open -> languishing ___ Python tracker <http://bugs.python.org/issue10298> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10298] zipfile: incorrect comment size will prevent extracting
Changes by rep : -- status: languishing -> pending ___ Python tracker <http://bugs.python.org/issue10298> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10298] zipfile: incorrect comment size will prevent extracting
rep added the comment: superseded by issue 10694 -- resolution: -> accepted status: pending -> closed ___ Python tracker <http://bugs.python.org/issue10298> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com