1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-25 10:50:08 +03:00

fuzz: Rework fixed parser options

Remove XML_PARSE_XINCLUDE. This is only honored by the XML Reader
interface which is now fuzzed in reader.c.

Don't validate in XInclude fuzzer. This doesn't increase coverage after
moving the Reader fuzzer.
This commit is contained in:
Nick Wellnhofer 2024-12-13 19:15:38 +01:00
parent 44628d4559
commit 6f903d434f
3 changed files with 3 additions and 4 deletions

View File

@ -33,7 +33,6 @@ LLVMFuzzerTestOneInput(const char *data, size_t size) {
xmlFuzzDataInit(data, size);
opts = (int) xmlFuzzReadInt(4);
opts &= ~XML_PARSE_XINCLUDE;
opts |= XML_PARSE_DTDVALID;
failurePos = xmlFuzzReadInt(4) % (size + 100);

View File

@ -35,7 +35,8 @@ LLVMFuzzerTestOneInput(const char *data, size_t size) {
xmlFuzzDataInit(data, size);
opts = (int) xmlFuzzReadInt(4);
opts |= XML_PARSE_XINCLUDE;
opts &= ~XML_PARSE_DTDVALID &
~XML_PARSE_SAX1;
failurePos = xmlFuzzReadInt(4) % (size + 100);
xmlFuzzReadEntities();

View File

@ -47,8 +47,7 @@ LLVMFuzzerTestOneInput(const char *data, size_t size) {
/*
* Disable options that are known to cause timeouts
*/
opts &= ~XML_PARSE_XINCLUDE &
~XML_PARSE_DTDVALID &
opts &= ~XML_PARSE_DTDVALID &
~XML_PARSE_SAX1;
failurePos = xmlFuzzReadInt(4) % (size + 100);