[libvirt] [PATCH 3/9] conf: events: don't crash on NULL uuid

Jovanka Gulicoska jovanka.gulicoska at gmail.com
Wed Jul 20 13:50:41 UTC 2016


nodedev events don't have a uuid value and will pass in NULL
---
 src/conf/object_event.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/conf/object_event.c b/src/conf/object_event.c
index cb984ff..bbef7f6 100644
--- a/src/conf/object_event.c
+++ b/src/conf/object_event.c
@@ -659,7 +659,8 @@ virObjectEventNew(virClassPtr klass,
         return NULL;
     }
     event->meta.id = id;
-    memcpy(event->meta.uuid, uuid, VIR_UUID_BUFLEN);
+    if (uuid)
+        memcpy(event->meta.uuid, uuid, VIR_UUID_BUFLEN);
 
     VIR_DEBUG("obj=%p", event);
     return event;
-- 
2.7.4




More information about the libvir-list mailing list