[PATCH] lib: Don't access configuration if none is present

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

 



Commit e457d5ef2015e6106094b85f8bbd1582002edc4d adds ability to pass the
default URI using the client configuration file. If the file is not
present, it still accesses the NULL config object causing a segfault.

Caught running "make check".
---
 src/libvirt.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/libvirt.c b/src/libvirt.c
index 1c0cdf7..d0b1b28 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -1085,7 +1085,8 @@ virConnectOpenResolveURIAlias(virConfPtr conf,

     *uri = NULL;

-    if ((value = virConfGetValue(conf, "uri_aliases")))
+    if (conf &&
+        (value = virConfGetValue(conf, "uri_aliases")))
         ret = virConnectOpenFindURIAliasMatch(value, alias, uri);
     else
         ret = 0;
-- 
1.7.3.4

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