[issue1622] zipfile hangs on certain zip files
report at bugs.python.org
Mon Jan 7 01:49:27 CET 2008
Eric Huss added the comment:
Some of this work has already been done, see issue 1189216.
You'll obviously need to keep the CRC unpack as signed because the
binascii module uses signed values.
Some header values are stored as 0xffffffff to denote the value is stored
in the 64-bit extended fields. There are a few places in the zipfile
module that use -1 to achieve this. This will cause a deprecation warning
when passed into the struct module:
DeprecationWarning: struct integer overflow masking is deprecated
The places that check for this appear to always check for both -1 and
0xfffffff, so that should be safe. Could potentially even remove the -1
check, not sure why it's checking for both. In general, you should
probably review the 64-bit support with a fine-toothed comb.
There are some other signed fields in the spec, but I don't think any of
them apply to the zipfile module. Some of them are timestamps in the
extra fields (Extended Timestamp and Info-ZIP Mac Extra fields).
I'd also keep an eye on other zipfile bugs that appear to be sign-related
(which you appear to have already looked at), such as issues 1189216,
1060, 1760357, 1526.
Tracker <report at bugs.python.org>
More information about the Python-bugs-list