From 4d617d0e015a5f811f3f7a5a6fe5c41936075674 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 18 May 2025 17:22:10 +0200 Subject: [PATCH] tests/fuzz: ignore huge data in fuzz testing of calculation functions --- tests/fuzz/core/calc-fuzzer.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/fuzz/core/calc-fuzzer.cc b/tests/fuzz/core/calc-fuzzer.cc index 85719cefb..ca861aa3a 100644 --- a/tests/fuzz/core/calc-fuzzer.cc +++ b/tests/fuzz/core/calc-fuzzer.cc @@ -35,6 +35,10 @@ extern "C" int LLVMFuzzerTestOneInput (const uint8_t *data, size_t size) { char *str; + /* ignore huge data */ + if (size > 65536) + return 0; + str = (char *)malloc (size + 1); memcpy (str, data, size); str[size] = '\0';