mirror of https://github.com/google/oss-fuzz.git
Limits input size for gnupg list fuzz target (#2987)
This commit is contained in:
parent
fd56d723bb
commit
f03d6345d4
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue