[PATCH 1/1] The virJSONValueObjectGetString function can return NULL, there are no checks

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

 



The devAlias check is performed in the "if (!devAlias && !devid) {", so the situation is not handled when devAlias is NULL, and devid is not NULL

Signed-off-by: Sergey Mironov <mironov@xxxxxxxxxx>
---
 src/qemu/qemu_monitor_json.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 5b9edadcf7..80b41d77d3 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -933,6 +933,11 @@ qemuMonitorJSONHandleTrayChange(qemuMonitor *mon,
     bool trayOpened;
     int reason;
 
+    if (!devAlias) {
+        VIR_WARN("missing device in tray change event");
+        return;
+    }
+
     /* drive alias is always reported but empty for -blockdev */
     if (*devAlias == '\0')
         devAlias = NULL;
-- 
2.31.1





[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]

  Powered by Linux