]> git.ipfire.org Git - thirdparty/libarchive.git/commit
Handle ZIP files with padding in the extra fields 1074/head
authorJoe Damato <ice799@gmail.com>
Fri, 12 Oct 2018 00:40:45 +0000 (17:40 -0700)
committerJoe Damato <ice799@gmail.com>
Fri, 12 Oct 2018 00:54:12 +0000 (17:54 -0700)
commit353fc56c3bf3ed7ed7b183d41ddce74c830c29cc
tree919b08d0e51728b44479bce481708a18fda3eda4
parentd5f35a90a4cb1eeb918213bff9d78e8b0471dc0a
Handle ZIP files with padding in the extra fields

Some ZIP files (certain android AAR packages) include ZIP extra fields
that appear to be padded with 0s. This is technically incorrect, however
other ZIP implementations appear to deal with these type of technically
malformed files. It appears that these broken implementations may be
padding the field to end on a word-aligned boundary.

Instead of generating an error if the length of the extra field is less
than the minimum size (4 bytes), consume the 1 - 3 bytes while checking that
each byte is zero. If all bytes are zero, no error is raised.
libarchive/archive_read_support_format_zip.c