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(a)redhat.com>
---
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