render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
9119d9
From 9951acfdcb794b4ab2af9e6f494e09cdf74f6c68 Mon Sep 17 00:00:00 2001
9119d9
Message-Id: <9951acfdcb794b4ab2af9e6f494e09cdf74f6c68@dist-git>
898951
From: Erik Skultety <eskultet@redhat.com>
9119d9
Date: Thu, 18 Sep 2014 15:16:09 +0200
898951
Subject: [PATCH] Fix libvirtd crash when removing metadata
898951
898951
When trying to remove nonexistent metadata from XML, libvirt daemon
898951
crashes due to dereferencing NULL pointer.
898951
898951
Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1143955
898951
898951
(cherry picked from commit 288c47406cffa7a6eb9e9c29764850b0cdeb5508)
898951
898951
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
898951
---
898951
 src/util/virxml.c | 3 +++
898951
 1 file changed, 3 insertions(+)
898951
898951
diff --git a/src/util/virxml.c b/src/util/virxml.c
9119d9
index cc4a85c..9ce705a 100644
898951
--- a/src/util/virxml.c
898951
+++ b/src/util/virxml.c
9119d9
@@ -974,6 +974,9 @@ virXMLFindChildNodeByNs(xmlNodePtr root,
898951
 {
898951
     xmlNodePtr next;
898951
 
898951
+    if (!root)
898951
+        return NULL;
898951
+
898951
     for (next = root->children; next; next = next->next) {
898951
         if (next->ns &&
898951
             STREQ_NULLABLE((const char *) next->ns->href, uri))
898951
-- 
9119d9
2.1.1
898951