[issue4228] struct.pack('L', -1)

Andreas Schawo report at bugs.python.org
Wed Mar 18 12:20:20 CET 2009


Andreas Schawo <andreas.schawo at gmail.com> added the comment:

As I understand actually the zipfile module possibly creates damaged zip
files after version 2.4 because of '\x00\x00\x00\x00' instead of
'\xff\xff\xff\xff' as header offset. But without any error.

I think the _struct.c should be cleaned in any case. Because we only get
errors in zipfile module when damaged zip files are created. An error
would be appriciated instead of a silenty damaged zip file.

But, why don't boundary check the header offset in zipfile module in a
short private  function and returning '\xff\xff\xff\xff' in case of
overflow? Maybe all longs should be boundary checked if this seems
necassery.

----------
nosy: +andreas.schawo

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4228>
_______________________________________


More information about the Python-bugs-list mailing list