aboutsummaryrefslogtreecommitdiff
path: root/fuzz/fuzz_alg_memmem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fuzz/fuzz_alg_memmem.cpp')
-rw-r--r--fuzz/fuzz_alg_memmem.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/fuzz/fuzz_alg_memmem.cpp b/fuzz/fuzz_alg_memmem.cpp
index c8e1e1661..7bafb8554 100644
--- a/fuzz/fuzz_alg_memmem.cpp
+++ b/fuzz/fuzz_alg_memmem.cpp
@@ -29,7 +29,10 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
/* Let use this fuzzer to check also this simple function... */
- ndpi_strlcpy(dst, (const char *)h, sizeof(dst), h_len);
+ if(fuzzed_data.ConsumeBool())
+ ndpi_strlcpy(dst, (const char *)h, sizeof(dst), h_len);
+ else
+ ndpi_strlcpy(NULL, (const char *)h, 0, h_len);
return 0;
}