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

Re: [libvirt] [PATCH 6/8] qemu: avoid null deref on low memory



At 2011-7-2 7:36, Eric Blake write:
Detected by Coverity.  qemuDomainEventQueue requires a non-NULL
pointer; most callers silently drop the event if we encountered
and OOM situation trying to create the event.

* src/qemu/qemu_migration.c (qemuMigrationFinish): Check for OOM.
---
  src/qemu/qemu_migration.c |    3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 800b714..d7b27a0 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2552,7 +2552,8 @@ qemuMigrationFinish(struct qemud_driver *driver,
                                           VIR_DOMAIN_EVENT_RESUMED_MIGRATED);
          if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PAUSED) {
              virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_USER);
-            qemuDomainEventQueue(driver, event);
+            if (event)
+                qemuDomainEventQueue(driver, event);
              event = virDomainEventNewFromObj(vm,
                                               VIR_DOMAIN_EVENT_SUSPENDED,
                                               VIR_DOMAIN_EVENT_SUSPENDED_PAUSED);
ACK


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