1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 20:28:11 +00:00
serenity/Meta/Lagom/Fuzzers/FuzzBrotli.cpp
Tim Schumacher ed4c2f2f8e LibCore: Rename Stream::read_all to read_until_eof
This generally seems like a better name, especially if we somehow also
need a better name for "read the entire buffer, but not the entire file"
somewhere down the line.
2022-12-12 14:16:42 +01:00

24 lines
652 B
C++

/*
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibCompress/Brotli.h>
#include <LibCore/MemoryStream.h>
#include <stdio.h>
extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size)
{
auto bufstream_result = Core::Stream::MemoryStream::construct({ data, size });
if (bufstream_result.is_error()) {
dbgln("MemoryStream::construct() failed.");
return 0;
}
auto bufstream = bufstream_result.release_value();
auto brotli_stream = Compress::BrotliDecompressionStream { *bufstream };
(void)brotli_stream.read_until_eof();
return 0;
}