]> git.ipfire.org Git - thirdparty/libarchive.git/commit
RAR5 reader: fix bad shift-left operations.
authorGrzegorz Antoniak <ga@anadoxin.org>
Wed, 1 May 2019 04:47:31 +0000 (06:47 +0200)
committerGrzegorz Antoniak <ga@anadoxin.org>
Wed, 1 May 2019 04:47:31 +0000 (06:47 +0200)
commit02f465f175f9925a1779e09e9f5f563e5a8fc5b4
tree850fffdd6e1021276bd7328e76fabf096d7363f8
parent4bd12b6f40cb4413c8970c52f15f3b6885b5e32f
RAR5 reader: fix bad shift-left operations.

This commit fixes some undefined shift-left operations on types that do
not support such a big shift. Those invalid shift operations were
triggering on invalid files produced by fuzzing.

The commit also contains two unit tests that ensure such problems won't
arise in the future.

Fixes OSSFuzz cases #14490 and #14491.
libarchive/archive_read_support_format_rar5.c
libarchive/test/test_read_format_rar5.c
libarchive/test/test_read_format_rar5_leftshift1.rar.uu [new file with mode: 0644]
libarchive/test/test_read_format_rar5_leftshift2.rar.uu [new file with mode: 0644]