mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2024-12-24 21:33:51 +03:00
fuzz: Check node type before xmlDocSetRootElement
This commit is contained in:
parent
5c55332591
commit
fe3cbf897e
@ -1688,6 +1688,8 @@ LLVMFuzzerTestOneInput(const char *data, size_t size) {
|
||||
root = getNode(2);
|
||||
if (doc != NULL && doc->parent != NULL)
|
||||
doc = NULL;
|
||||
if (!isValidChild((xmlNodePtr) doc, root))
|
||||
root = NULL;
|
||||
oldDoc = root ? root->doc : NULL;
|
||||
oldParent = root ? root->parent : NULL;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user