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

Re: [Xen-devel] [PATCH] xl: Perform minimal validation of virtual disk file while parsing config file



On Fri, 2011-01-21 at 12:17 +0000, Ian Jackson wrote:
> Kamala Narasimhan writes ("Re: [Xen-devel] [PATCH] xl: Perform minimal 
> validation of virtual disk file while parsing config file"):
> > Here is a revised patch.  Please let me know if there are further 
> > suggestions.
> ...
> > +    assert(file_name);
> 
> I don't think we need this.  If the pointer is null dereferencing it
> will crash cleanly in just a moment.
> 
> > +    if ( (strlen(file_name) == 0) && (disk_type == PHYSTYPE_PHY) )
> > +        return 0;
> 
> strlen still seems overkill.

As opposed to file_name[0] == '\0' ?

I think strlen() is clearer about the meaning of the condition being
checked. Please let's not micro-optimise to this level.

Gianni


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.