mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-05-28 13:05:33 +03:00
Improve HTML fuzzer stability
Call htmlInitAutoClose during fuzzer initialization to fix stability issue. Leave a note concerning problems with this function.
This commit is contained in:
parent
09320f0551
commit
de1b51eddc
@ -1324,6 +1324,10 @@ htmlCheckAutoClose(const xmlChar * newtag, const xmlChar * oldtag)
|
||||
int i, indx;
|
||||
const char **closed = NULL;
|
||||
|
||||
/*
|
||||
* FIXME: This is not thread-safe and should be called from
|
||||
* xmlInitParser instead.
|
||||
*/
|
||||
if (htmlStartCloseIndexinitialized == 0)
|
||||
htmlInitAutoClose();
|
||||
|
||||
|
@ -6,12 +6,14 @@
|
||||
|
||||
#include <libxml/HTMLparser.h>
|
||||
#include <libxml/HTMLtree.h>
|
||||
#include <libxml/parserInternals.h>
|
||||
#include "fuzz.h"
|
||||
|
||||
int
|
||||
LLVMFuzzerInitialize(int *argc ATTRIBUTE_UNUSED,
|
||||
char ***argv ATTRIBUTE_UNUSED) {
|
||||
xmlInitParser();
|
||||
htmlInitAutoClose();
|
||||
xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
|
||||
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user