Re: [PATCH 2/2] lxc: Don't crash on NULL ifname_guest_actual

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

 



On Fri, Dec 19, 2014 at 11:26:10AM +0100, Cedric Bosdonnat wrote:
> On Fri, 2014-12-19 at 10:46 +0100, Guido Günther wrote:
> > Reported and patch provided by Bastian Blank at
> > 
> >     https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=769600
> > ---
> >  src/lxc/lxc_container.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
> > index 1b9e2f2..f986f71 100644
> > --- a/src/lxc/lxc_container.c
> > +++ b/src/lxc/lxc_container.c
> > @@ -472,7 +472,7 @@ lxcContainerGetNetDef(virDomainDefPtr vmDef, const char *devName)
> >  
> >      for (i = 0; i < vmDef->nnets; i++) {
> >          netDef = vmDef->nets[i];
> > -        if (STREQ(netDef->ifname_guest_actual, devName))
> > +        if (netDef->ifname_guest_actual && STREQ(netDef->ifname_guest_actual, devName))
> 
> Would be better to just have 
> if (STREQ_NULLABLE(netDef->ifname_guest_actual, devName))

Indeed. Thanks!
 -- Guido

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