mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 12:27:36 +00:00
LibArchive: Make TarInputStream::advance report errors
Fixes this bug that was reported by OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=52862
This commit is contained in:
parent
26a4327b06
commit
c88d8a21cc
4 changed files with 18 additions and 8 deletions
|
@ -16,7 +16,7 @@ extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
|
|||
if (!tar_stream.valid())
|
||||
return 0;
|
||||
|
||||
for (; !tar_stream.finished(); tar_stream.advance()) {
|
||||
while (!tar_stream.finished()) {
|
||||
auto const& header = tar_stream.header();
|
||||
|
||||
if (!header.content_is_like_extended_header())
|
||||
|
@ -33,6 +33,10 @@ extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
|
|||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
auto maybe_error = tar_stream.advance();
|
||||
if (maybe_error.is_error())
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue