[PATCH 1/3] virDomainDeviceValidateAliasForHotplug: Use correct domain defintion

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

 



https://bugzilla.redhat.com/show_bug.cgi?id=1553075

For some weird reason this function is getting live and
persistent def for domain but then accesses vm->def and
vm->newDef directly. This is rather unsafe as we can be
accessing NULL pointer.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/conf/domain_conf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 70b19311b..b98b1ca42 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -5679,11 +5679,11 @@ virDomainDeviceValidateAliasForHotplug(virDomainObjPtr vm,
         return -1;
 
     if (persDef &&
-        virDomainDeviceValidateAliasImpl(vm->def, dev) < 0)
+        virDomainDeviceValidateAliasImpl(persDef, dev) < 0)
         return -1;
 
     if (liveDef &&
-        virDomainDeviceValidateAliasImpl(vm->newDef, dev) < 0)
+        virDomainDeviceValidateAliasImpl(liveDef, dev) < 0)
         return -1;
 
     return 0;
-- 
2.16.1

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