Re: [PATCH] qemu: add pointer check in qemuMonitorLastError

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

 





On 9/19/19 5:01 AM, Xu Yandong wrote:
We found a exception when libvirt occurrs segmentation fault.
thread 1 is waiting object lock in qemuConnectMonitor,
qemu process exits and sends EOF event as well, so thread 2 invokes
qemuMonitorLastError but pointer mon is NULL.

Signed-off-by: Xu Yandong <xuyandong2@xxxxxxxxxx>
---

Reviewed-by: Daniel Henrique Barboza <danielhb413@xxxxxxxxx>

  src/qemu/qemu_monitor.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index aa230b3306..28f18391a5 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -1103,7 +1103,7 @@ qemuMonitorSend(qemuMonitorPtr mon,
  virErrorPtr
  qemuMonitorLastError(qemuMonitorPtr mon)
  {
-    if (mon->lastError.code == VIR_ERR_OK)
+    if (!mon || mon->lastError.code == VIR_ERR_OK)
          return NULL;
return virErrorCopyNew(&mon->lastError);

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

  Powered by Linux