1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-02-04 21:47:16 +03:00

Fix libvirtd crash when removing metadata

When trying to remove nonexistent metadata from XML, libvirt daemon
crashes due to dereferencing NULL pointer.

Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1143955
This commit is contained in:
Erik Skultety 2014-09-18 14:25:05 +02:00 committed by Peter Krempa
parent 15ee3c2511
commit 288c47406c

View File

@ -974,6 +974,9 @@ virXMLFindChildNodeByNs(xmlNodePtr root,
{
xmlNodePtr next;
if (!root)
return NULL;
for (next = root->children; next; next = next->next) {
if (next->ns &&
STREQ_NULLABLE((const char *) next->ns->href, uri))