Re: [PATCH] Check for NULL in qemu monitor event filter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/22/2014 06:09 AM, Ján Tomko wrote:
> 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(-)

That's one alternative.  I was thinking more along the lines of
forbidding the use of flags with a NULL event string:

diff --git i/src/libvirt-qemu.c w/src/libvirt-qemu.c
index fed08fc..e9bc82e 100644
--- i/src/libvirt-qemu.c
+++ w/src/libvirt-qemu.c
@@ -289,6 +289,9 @@
virConnectDomainQemuMonitorEventRegister(virConnectPtr conn,
     }
     virCheckNonNullArgGoto(cb, error);
     virCheckReadOnlyGoto(conn->flags, error);
+    if (flags & (VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_REGEX |
+                 VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_NOCASE))
+        virCheckNonNullArgGoto(event, error);

     if (conn->driver &&
conn->driver->connectDomainQemuMonitorEventRegister) {
         int ret;


-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]