summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fe-fuzz/irc/core/event-get-params.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/fe-fuzz/irc/core/event-get-params.c b/src/fe-fuzz/irc/core/event-get-params.c
index fc21bbeb..f8060ffe 100644
--- a/src/fe-fuzz/irc/core/event-get-params.c
+++ b/src/fe-fuzz/irc/core/event-get-params.c
@@ -52,7 +52,8 @@ int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
return 0;
}
uint8_t count = *data;
- char *copy = malloc(sizeof(char)*(size-1+1));
+ /* malloc(size) instead of size+1, because we already used one byte of data */
+ char *copy = malloc(size);
memcpy(copy, data+1, size-1);
copy[size-1] = '\0';