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

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

 



On Thu, Mar 15, 2012 at 05:22:28PM +0100, Peter Krempa wrote:
> 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;

ACK


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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