]> git.ipfire.org Git - thirdparty/libarchive.git/commit
Issue 553: Fix broken decryption for ZIP files.
authorTim Kientzle <kientzle@gmail.com>
Thu, 16 Jun 2016 01:38:30 +0000 (18:38 -0700)
committerTim Kientzle <kientzle@gmail.com>
Thu, 16 Jun 2016 01:38:30 +0000 (18:38 -0700)
commitd85976e7ff4a062e1de6e04dab7bb78e3344768f
treee24129d2c860b60508994c2b8a40e27576c21ce9
parent26b6d6d48f01c9554ab7e0b673aa562b40fc598b
Issue 553: Fix broken decryption for ZIP files.

Sometimes, decompressing was failing due to miscalculation of buffer
offsets, and hence causing a silent buffer overflow.

When a previous chunk decompression left some bytes in the decryption
buffer, it was not taken into account in determining space left in the
decompression buffer.

So, it could happen, that the decryption buffer is completely full,
but some bytes are not used yet. In such case, even though the buffer
is full, the code tried to decrypt more bytes behind it's boundary.

This CL resolves this issue by properly calculating the amount of
space left in the decompression buffer.

(This is an edited version of Tomasz Mikolajewski's pull request.)
libarchive/archive_read_support_format_zip.c