Re: [libvirt] [PATCH] Avoid segv if ncf_init fails

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

 



On Tue, 2009-10-27 at 14:23 +0000, David Lutterkort wrote:
> On Fri, 2009-10-23 at 20:31 +0100, Daniel P. Berrange wrote:
> > On Fri, Oct 23, 2009 at 03:13:17PM -0400, Laine Stump wrote:
> > > If ncf_init() fails, it takes responsibility to call ncf_close() when
> > > appropriate. Having libvirt call it results in a double close, which
> > > ends up segv'ing.
> > 
> > Hmm, it would be good if ncf_init  set the passed in pointer to NULL
> > when it failed, then your existing cleanup check would have been
> > safe.
> 
> Agreed - that that doesn't happen was an oversight. I'll fix that.

Spoke too soon - ncf_init returns -2 when allocations fail so badly that
we can't even allocate the struct netcf (in which case ncf_init should
reset the pointer to NULL, but doesn't - that's the bug that needs to be
addressed) 

It can also return -1 for all kinds of other failures; in that case you
have a struct netcf that's good enough to pass to ncf_error to get more
error details.

David


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