On Monday, August 29, 2011 04:07:14 Michal Simek wrote:
> Mike Frysinger wrote:
> > On Friday, August 26, 2011 08:52:40 Michal Simek wrote:
> >> If name is longer than allocated space NAMESIZE
> >> mac address is rewritten which show error
> > 
> >> message like:
> > since you overflowed the buffer, who knows what could happen ...
> > 
> >> +  if (strlen(dev->name) > NAMESIZE) {
> >> +          printf("Long(%d>%d) network driver name for %s\n",
> >> +                                  strlen(dev->name), NAMESIZE, dev->name);
> >> +          return 0;
> >> +  }
> > 
> > size_t len = strlen(dev->name);
> > if (len >= NAMESIZE) {
> > 
> >     printf("network driver name is too long (%zu >= %zu): %s\n",
> >     
> >             len, NAMESIZE, dev->name);
> >     
> >     return -1;
> > 
> > }
> 
> ok. I see it is 15 chars space + terminated characters.
> 
> Mike: Will you propose this patch or should I do it?

since you've got stuff pending here, best for you to do it :)
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to