]> git.ipfire.org Git - thirdparty/libarchive.git/commit
RAR5 reader: invalid window buffer read in E8E9 filter 1172/head
authorGrzegorz Antoniak <ga@anadoxin.org>
Sat, 2 Feb 2019 07:46:24 +0000 (08:46 +0100)
committerGrzegorz Antoniak <ga@anadoxin.org>
Wed, 17 Apr 2019 03:56:39 +0000 (05:56 +0200)
commitd57e7a9228125542a0f9cf18d42a84f70ed47df5
tree152c4671ac7d713b6e616f2362cb7b14d8bc6751
parent660802fa971274258a91be9a239b7528983e2f81
RAR5 reader: invalid window buffer read in E8E9 filter

The E8E9 filter was accessing the window buffer with a direct memory
read. But since the window buffer is a circular buffer, some of its data
can span between the end of the buffer and beginning of the buffer. This
means that accessing the window buffer needs to be done always by a
reading function that is aware of the fact that the window buffer is
circular.

The commit changes direct memory read to the access through the
circular_memcpy() function.

This fixes some edge cases when the E8E9 filter data (4 bytes) is
spanned between the end of the window buffer and the beginning of the
buffer. This situation can happen in archives compressed with a small
dictionary size.
libarchive/archive_read_support_format_rar5.c