1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-24 13:33:01 +03:00

valid: Readd argument check in xmlAddElementDecl

Fix crashes with API fuzzer.
This commit is contained in:
Nick Wellnhofer
2025-05-27 12:19:25 +02:00
parent 78454e30e9
commit 77c583e0f7
2 changed files with 6 additions and 6 deletions

View File

@@ -38,6 +38,9 @@
#ifndef XML_DEPRECATED
#define XML_DEPRECATED
#endif
#ifndef XML_DEPRECATED_MEMBER
#define XML_DEPRECATED_MEMBER
#endif
#include <libxml/catalog.h>
#include <libxml/HTMLtree.h>
@@ -2649,7 +2652,7 @@ LLVMFuzzerTestOneInput(const char *data, size_t size) {
oomReport = 0;
/*
* Don't reference XML_ELEMENT_TYPE_UNDEFINED dummy
* declarations.
* declarations which can be freed by xmlAddElementDecl.
*/
if (elem != NULL && elem->parent == NULL)
elem = NULL;