1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-27 18:50:07 +03:00

fuzz: Fix duplicate detection in fuzzEntityRecorder

Store a non-NULL value in the hash.
This commit is contained in:
Nick Wellnhofer 2023-02-28 21:16:12 +01:00
parent 791a1e80b9
commit f560065f4d

View File

@ -82,7 +82,8 @@ fuzzEntityRecorder(const char *URL, const char *ID,
xmlFreeInputStream(in);
xmlHashAddEntry(globalData.entities, (const xmlChar *) URL, NULL);
xmlHashAddEntry(globalData.entities, (const xmlChar *) URL,
globalData.entities);
return(xmlNoNetExternalEntityLoader(URL, ID, ctxt));
}
@ -98,7 +99,7 @@ fuzzRecorderInit(FILE *out) {
static void
fuzzRecorderCleanup(void) {
xmlSetExternalEntityLoader(globalData.oldLoader);
xmlHashFree(globalData.entities, xmlHashDefaultDeallocator);
xmlHashFree(globalData.entities, NULL);
globalData.out = NULL;
globalData.entities = NULL;
globalData.oldLoader = NULL;