mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 20:38:12 +00:00

Previously, some fuzzers were generating an excessive amount of debug logging. This change explicitly disables debug logging for all fuzzers. This allows higher test throughput and makes the logs easier to read when fuzzing locally.
23 lines
628 B
C++
23 lines
628 B
C++
/*
|
|
* Copyright (c) 2021, the SerenityOS developers.
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <AK/MemoryStream.h>
|
|
#include <LibCompress/Zlib.h>
|
|
#include <stdio.h>
|
|
|
|
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
|
|
{
|
|
AK::set_debug_enabled(false);
|
|
|
|
auto stream = make<FixedMemoryStream>(ReadonlyBytes { data, size });
|
|
|
|
auto decompressor_or_error = Compress::ZlibDecompressor::create(move(stream));
|
|
if (decompressor_or_error.is_error())
|
|
return 0;
|
|
auto decompressor = decompressor_or_error.release_value();
|
|
(void)decompressor->read_until_eof();
|
|
return 0;
|
|
}
|