|  |  | 
  
    |  |  | 
 
  |   |  | 
  
    |  |  | 
  
    |  |  | 
  
    |   xen-devel
Re: [Xen-devel] [PATCH] xl: Perform minimal validation of virtual	disk f 
| 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
 | 
 
| <Prev in Thread] | Current Thread | [Next in Thread> |  | 
Re: [Xen-devel] [PATCH] xl: Perform minimal validation of virtual	disk file while parsing config file, (continued)
Re: [Xen-devel] [PATCH] xl: Perform minimal validation of virtual	disk file while parsing config file, Kamala Narasimhan
Re: [Xen-devel] [PATCH] xl: Perform minimal validation of virtual	disk file while parsing config file, Ian Jackson
Re: [Xen-devel] [PATCH] xl: Perform minimal validation of virtual	disk file while parsing config file, Kamala Narasimhan
Re: [Xen-devel] [PATCH] xl: Perform minimal validation of virtual	disk file while parsing config file, Kamala Narasimhan
Re: [Xen-devel] [PATCH] xl: Perform minimal validation of virtual	disk file while parsing config file, Ian Jackson
Re: [Xen-devel] [PATCH] xl: Perform minimal validation of virtual	disk file while parsing config file,
Gianni Tedesco <=
Re: [Xen-devel] [PATCH] xl: Perform minimal validation of virtual	disk file while parsing config file, Kamala Narasimhan
Re: [Xen-devel] [PATCH] xl: Perform minimal validation of virtual	disk file while parsing config file, Ian Jackson
Re: [Xen-devel] [PATCH] xl: Perform minimal validation of virtual	disk file while parsing config file, Kamala Narasimhan
Re: [Xen-devel] [PATCH] xl: Perform minimal validation of virtual	disk file while parsing config file, Ian Jackson
Re: [Xen-devel] [PATCH] xl: Perform minimal validation of virtual	disk file while parsing config file, Kamala Narasimhan
Re: [Xen-devel] [PATCH] xl: Perform minimal validation of virtual	disk file while parsing config file, Ian Campbell
Re: [Xen-devel] [PATCH] xl: Perform minimal validation of virtual	disk file while parsing config file, Ian Jackson
Re: [Xen-devel] [PATCH] xl: Perform minimal validation of virtual	disk file while parsing config file, Ian Campbell
Re: [Xen-devel] [PATCH] xl: Perform minimal validation of virtual	disk file while parsing config file, Kamala Narasimhan
Re: [Xen-devel] [PATCH] xl: Perform minimal validation of virtual	disk file while parsing config file, Kamala Narasimhan
 |  |  | 
  
    |  |  |