From 16f309314488c601daad2689924117a43a8ccbde Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Wed, 9 Sep 2026 14:14:40 +0300 Subject: [PATCH] Tests: Adjust coding style in fuzzers --- tests/ossfuzz/fuzz_common.h | 3 ++- tests/ossfuzz/fuzz_decode_alone.c | 1 + tests/ossfuzz/fuzz_decode_stream.c | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/ossfuzz/fuzz_common.h b/tests/ossfuzz/fuzz_common.h index b47a3bdf..0217ba36 100644 --- a/tests/ossfuzz/fuzz_common.h +++ b/tests/ossfuzz/fuzz_common.h @@ -25,7 +25,8 @@ static void -fuzz_code(lzma_stream *stream, const uint8_t *inbuf, size_t inbuf_size) { +fuzz_code(lzma_stream *stream, const uint8_t *inbuf, size_t inbuf_size) +{ // Output buffer for decompressed data. This is write only; nothing // cares about the actual data written here. uint8_t outbuf[4096]; diff --git a/tests/ossfuzz/fuzz_decode_alone.c b/tests/ossfuzz/fuzz_decode_alone.c index 1ef2f9e7..e11aa6be 100644 --- a/tests/ossfuzz/fuzz_decode_alone.c +++ b/tests/ossfuzz/fuzz_decode_alone.c @@ -21,6 +21,7 @@ extern int LLVMFuzzerTestOneInput(const uint8_t *inbuf, size_t inbuf_size) { lzma_stream strm = LZMA_STREAM_INIT; + // Initialize a LZMA alone decoder using the memory usage limit // defined in fuzz_common.h lzma_ret ret = lzma_alone_decoder(&strm, MEM_LIMIT); diff --git a/tests/ossfuzz/fuzz_decode_stream.c b/tests/ossfuzz/fuzz_decode_stream.c index d7860611..c5675056 100644 --- a/tests/ossfuzz/fuzz_decode_stream.c +++ b/tests/ossfuzz/fuzz_decode_stream.c @@ -21,6 +21,7 @@ extern int LLVMFuzzerTestOneInput(const uint8_t *inbuf, size_t inbuf_size) { lzma_stream strm = LZMA_STREAM_INIT; + // Initialize a .xz decoder using the memory usage limit // defined in fuzz_common.h //