]> git.ipfire.org Git - thirdparty/libarchive.git/commit
RAR5 reader: fix ASan errors, fix OSSFuzz samples, add a unit test 1181/head
authorGrzegorz Antoniak <ga@anadoxin.org>
Tue, 23 Apr 2019 05:23:43 +0000 (07:23 +0200)
committerGrzegorz Antoniak <ga@anadoxin.org>
Thu, 25 Apr 2019 04:47:39 +0000 (06:47 +0200)
commit39736c43bd7374beedb372aa300ecf36c9fc4733
tree2514935b8bc8612f76e3da8549d7ac8fffb2458f
parenta4744f65134ed3c38be7f3241e394e75fd28d7e7
RAR5 reader: fix ASan errors, fix OSSFuzz samples, add a unit test

This commit fixes errors reported by ASan, as well as fixes runtime
behavior of RAR5 reader on OSSFuzz sample files:

    #12999, #13029, #13144, #13478, #13490

Root cause for these changes is that merge_block() function was
sometimes called in a recursive way. But this function shouldn't be used
this way, because calling it recursively overwrites the global state
that is used by the function. So, the commit ensures the function will
not be called recursively.

There is also one fix that changes some tabs to spaces, because whole
file originally used space indentation.
libarchive/archive_read_support_format_rar5.c
libarchive/test/test_read_format_rar5.c