Hash :
eac1c7e2
Author :
Date :
2020-06-21T14:42:00
Fuzz target for XML Schemas This only tests the schema parser for now.
/*
* xmlSeed.c: Generate the XML seed corpus for fuzzing.
*
* See Copyright for the status of this software.
*/
#include <stdio.h>
#include "fuzz.h"
int
main(int argc, char **argv) {
int opts = XML_PARSE_NOENT | XML_PARSE_DTDLOAD;
if (argc != 2) {
fprintf(stderr, "Usage: xmlSeed [FILE]\n");
return(1);
}
fwrite(&opts, sizeof(opts), 1, stdout);
xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
xmlSetExternalEntityLoader(xmlFuzzEntityRecorder);
xmlFreeDoc(xmlReadFile(argv[1], NULL, opts));
xmlFuzzDataCleanup();
return(0);
}