[lxc-devel] [RFC 5/5] pass namespace handles to the stop hook

Wolfgang Bumiller w.bumiller at proxmox.com
Tue Sep 29 06:31:13 UTC 2015



> On September 28, 2015 at 5:12 PM Serge Hallyn <serge.hallyn at ubuntu.com> wrote:
> 
> 
> Quoting Wolfgang Bumiller (w.bumiller at proxmox.com):
> > ---
(...)
> > +			rc = asprintf(&namespaces[namespace_count++], "%s:/proc/%d/fd/%d",
> > +			              ns_info[i].proc_name, self, handler->nsfd[i]);
> 
> If asprintf fails, the contents of the first arg are undefined.  So iiuc
> the error loop below, on error, will try to first free an undefined
> value.    So I think the if (rc == -1) block needs to decrement
> namespace_count.

Ah yes, the snprintf patch on the list also made me aware of this ;-)
Will fix it.



More information about the lxc-devel mailing list