[PATCH 1/2] virDomainDeviceAliasIsUserAlias: tolerate NULL

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

 



Do not crash in virDomainDeviceInfoParseXML if someone provides
an 'alias' element without a 'name' attribute.

Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
---
 src/conf/domain_conf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 43725155c..d289ca2d0 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -6702,7 +6702,7 @@ virDomainDeviceAddressParseXML(xmlNodePtr address,
 bool
 virDomainDeviceAliasIsUserAlias(const char *aliasStr)
 {
-    return STRPREFIX(aliasStr, USER_ALIAS_PREFIX);
+    return aliasStr && STRPREFIX(aliasStr, USER_ALIAS_PREFIX);
 }
 
 
-- 
2.13.6

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