1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:47:44 +00:00

FuzzTar+tar: Advance the stream before continuing

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53733
This bug was caused by a regression introduced in c88d8a2.
This commit is contained in:
implicitfield 2022-11-25 16:30:45 +02:00 committed by Andreas Kling
parent 73e87d694e
commit 19e6befddc
2 changed files with 8 additions and 2 deletions

View file

@ -19,8 +19,12 @@ extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
while (!tar_stream.finished()) {
auto const& header = tar_stream.header();
if (!header.content_is_like_extended_header())
continue;
if (!header.content_is_like_extended_header()) {
if (tar_stream.advance().is_error())
return 0;
else
continue;
}
switch (header.type_flag()) {
case Archive::TarFileType::GlobalExtendedHeader: