diff --git a/projects/gnupg/fuzz_list.c b/projects/gnupg/fuzz_list.c index 07fc1db94..8e1e0034b 100644 --- a/projects/gnupg/fuzz_list.c +++ b/projects/gnupg/fuzz_list.c @@ -71,6 +71,9 @@ static void rmrfdir(char *path) } } +// 65kb should be enough ;-) +#define MAX_LEN 0x10000 + int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { IOBUF a; armor_filter_context_t *afx = NULL; @@ -132,6 +135,11 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { initialized = true; } + if (Size > MAX_LEN) { + // limit maximum size to avoid long computing times + Size = MAX_LEN; + } + memset(ctrlGlobal, 0, sizeof(*ctrlGlobal)); ctrlGlobal->magic = SERVER_CONTROL_MAGIC;