From e6ba6f0c781f94921c2bd3e8263e092f6a10d153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Duda?= Date: Thu, 23 May 2024 23:12:28 +0200 Subject: [PATCH] .. --- tests/fuzz/cli_received.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/fuzz/cli_received.cpp b/tests/fuzz/cli_received.cpp index a8a2a10e3f69..38b2f02bfad7 100644 --- a/tests/fuzz/cli_received.cpp +++ b/tests/fuzz/cli_received.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -68,6 +69,8 @@ void AdvanceTime(otInstance *aInstance, uint32_t aDuration) } } +static uint64_t gCounter = 0; + extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { const otPanId panId = 0xdead; @@ -75,6 +78,8 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) otInstance *instance = nullptr; uint8_t *buf = nullptr; + gCounter++; + VerifyOrExit(size <= 65536); FuzzerPlatformInit(); @@ -110,5 +115,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) otInstanceFinalize(instance); } + assert(gCounter<10); + return 0; }