]> git.ipfire.org Git - thirdparty/libarchive.git/commit
RAR5 reader: window_mask was not updated correctly 1212/head
authorGrzegorz Antoniak <ga@anadoxin.org>
Sun, 16 Jun 2019 07:49:05 +0000 (09:49 +0200)
committerGrzegorz Antoniak <ga@anadoxin.org>
Sun, 16 Jun 2019 07:49:05 +0000 (09:49 +0200)
commit47bb8187d3ef2d49ee8c7841cb2872b3cfa1f6f7
treeb4e1ee7866f61fc36bcb45d6b4c641163181d470
parentfa2f626ac0ebe0841370eadd3ffd69679258fa0a
RAR5 reader: window_mask was not updated correctly

The `window_mask` variable should be always in sync with the
`window_size` variable.

The commit fixes a bug in which there was one place that `window_size`
was modified, but `window_mask` wasn't updated. This was leading to a
SIGSEGV error, because by having wrong `window_mask`, RAR5 reader was
accessing the memory outsize current window buffer.

The commit also adds a test for this issue, together with OSSFuzz
sample #15278.
libarchive/archive_read_support_format_rar5.c
libarchive/test/test_read_format_rar5.c
libarchive/test/test_read_format_rar5_different_window_size.rar.uu [new file with mode: 0644]