Message120326
| Author |
rep |
| Recipients |
rep |
| Date |
2010年11月03日.14:00:35 |
| SpamBayes Score |
5.2215214e-09 |
| Marked as misclassified |
No |
| Message-id |
<1288792839.67.0.901999285278.issue10298@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2010年11月03日 14:00:39 | rep | set | recipients:
+ rep |
| 2010年11月03日 14:00:39 | rep | set | messageid: <1288792839.67.0.901999285278.issue10298@psf.upfronthosting.co.za> |
| 2010年11月03日 14:00:37 | rep | link | issue10298 messages |
| 2010年11月03日 14:00:36 | rep | create |
|