]> git.ipfire.org Git - thirdparty/libarchive.git/commit
Issue #770: Be more careful about extra_length
authorTim Kientzle <kientzle@acm.org>
Sun, 21 Aug 2016 16:25:00 +0000 (09:25 -0700)
committerTim Kientzle <kientzle@acm.org>
Sun, 21 Aug 2016 16:34:46 +0000 (09:34 -0700)
commit36bb164e221a3a76488f2ceaf808db14de6f8ca4
tree9a7bc8fbc152c32e63db7fe6daeee1d340665335
parent45f5a39807e19f1006520bff7d23edb357bfe9cd
Issue #770:  Be more careful about extra_length

Hanno Böck pointed out that the loop here computes
extra_length - 4 without first checking for possible underflow.

In addition to fixing this, I also added a bunch of error
checks so Zip parsing will fail if any Zip extra field
is malformed.  Among other things, this uncovered an
old bug that would skip a trailing extra field with
zero-sized data.

Note that we still simply ignore well-formed
extra fields that we don't understand.
libarchive/archive_read_support_format_zip.c