diff options
author | Nick Wellnhofer <wellnhofer@aevum.de> | 2020-12-16 15:41:52 +0100 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2020-12-16 16:12:07 +0100 |
commit | 9086988ffa8da62c25c764a146a84603629734aa (patch) | |
tree | 69063f4c267aa53674191ec47643da1c096b0c4d /fuzz/schema.c | |
parent | 1fe385304f11332ddb232571d54d36a5aeca0398 (diff) | |
download | libxml2-9086988ffa8da62c25c764a146a84603629734aa.tar.gz |
Enforce maximum length of fuzz input
Remove the libfuzzer max_len option which doesn't apply to other
fuzzing engines. Enforce the maximum length directly in the fuzz
targets. For the xml target, lower the maximum when expanding entities
to avoid timeout and OOM errors.
Diffstat (limited to 'fuzz/schema.c')
-rw-r--r-- | fuzz/schema.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fuzz/schema.c b/fuzz/schema.c index f1ee9380..7b034eca 100644 --- a/fuzz/schema.c +++ b/fuzz/schema.c @@ -21,6 +21,9 @@ int LLVMFuzzerTestOneInput(const char *data, size_t size) { xmlSchemaParserCtxtPtr pctxt; + if (size > 50000) + return(0); + xmlFuzzDataInit(data, size); xmlFuzzReadEntities(); |