On Tue, Mar 31, 2009 at 02:58:37PM +0100, Daniel P. Berrange wrote:
On Tue, Mar 31, 2009 at 12:09:21PM +0200, Daniel Veillard wrote:
>
> > +#define MAX_INDENT 100
> > +
> > +static void
> > +cmdNodeListDevicesPrint(vshControl *ctl,
> > + char **devices,
> > + char **parents,
> > + int num_devices,
> > + int devid,
> > + int lastdev,
> > + unsigned int depth,
> > + char *indent)
> > +{
> > + int i;
> > + int nextlastdev = -1;
>
> Before even modifying indent[depth] here I would check that
> depth + 2 < MAX_INDENT and abort on an error here,
Actually we have a 4 level indent here. This is all getting
rather confusing, so I've separated the depth we've descended
from the indentation used, and defined the buffer to be a
multiple of max depth.
Also fixed a minor leak in the virNodeDeviceGetParent() impl
of the remote driver. In the wonderful world of XDR, we have
to free the char**, but not the char *.
Okidoc, ACK !
thanks,
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit
http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine
http://rpmfind.net/
http://veillard.com/ | virtualization library
http://libvirt.org/