[libvirt] [PATCH] Check for NULL in qemu monitor event filter

Ján Tomko jtomko at redhat.com
Mon Sep 22 12:09:55 UTC 2014


When virConnectDomainQemuMonitorEventRegister is called with the
VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_REGEX flag,
ignore the flag instead of crashing.

https://bugzilla.redhat.com/show_bug.cgi?id=1144920
---
 src/conf/domain_event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/conf/domain_event.c b/src/conf/domain_event.c
index 73ae289..c8f6830 100644
--- a/src/conf/domain_event.c
+++ b/src/conf/domain_event.c
@@ -1705,7 +1705,7 @@ virDomainQemuMonitorEventStateRegisterID(virConnectPtr conn,
     if (VIR_ALLOC(data) < 0)
         return -1;
     data->flags = flags;
-    if (flags != -1) {
+    if (event && flags != -1) {
         int rflags = REG_NOSUB;
 
         if (flags & VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_NOCASE)
-- 
1.8.5.5




More information about the libvir-list mailing list