libxml: Fix possible null pointer access (regression 2023-05-26).

Pinpointed by gcc 13 warning:
warning: dereference of NULL ‘clone’ [CWE-476] [-Wanalyzer-null-dereference]

* gnulib-local/lib/libxml/tree.c (xmlDOMWrapCloneNode): Assign clone from
cloneAttr.
This commit is contained in:
Bruno Haible 2023-06-03 01:21:57 +02:00
parent 36cc99cdc6
commit fb24c965db

View File

@ -9521,6 +9521,7 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt,
goto internal_error;
}
memset(cloneAttr, 0, sizeof(xmlAttr));
clone = (xmlNodePtr) cloneAttr;
/*
* Set hierachical links.
* TODO: Change this to add to the end of attributes.