/src/serenity/Meta/Lagom/Fuzzers/FuzzBrotli.cpp
Line | Count | Source |
1 | | /* |
2 | | * Copyright (c) 2022, the SerenityOS developers. |
3 | | * |
4 | | * SPDX-License-Identifier: BSD-2-Clause |
5 | | */ |
6 | | |
7 | | #include <AK/MemoryStream.h> |
8 | | #include <LibCompress/Brotli.h> |
9 | | #include <stdio.h> |
10 | | |
11 | | extern "C" int LLVMFuzzerTestOneInput(uint8_t const* data, size_t size) |
12 | 92.7k | { |
13 | 92.7k | AK::set_debug_enabled(false); |
14 | 92.7k | FixedMemoryStream bufstream { { data, size } }; |
15 | | |
16 | 92.7k | auto brotli_stream = Compress::BrotliDecompressionStream { MaybeOwned<Stream> { bufstream } }; |
17 | | |
18 | 92.7k | (void)brotli_stream.read_until_eof(); |
19 | 92.7k | return 0; |
20 | 92.7k | } |