Re: [U-Boot] [PATCH] miiphy: use strcpy() not sprintf()

2011-07-15 Thread Laurence Withers
On Thu, Jul 14, 2011 at 02:02:42PM -0400, Mike Frysinger wrote: > On Thursday, July 14, 2011 09:49:23 Albert ARIBAUD wrote: > > Please use strncpy() which will also guard against overflows. > > or BUG_ON(strlen(name) >= MDIO_NAME_LEN) > -mike Patch v3 has both. The original code did have a check

Re: [U-Boot] [PATCH] miiphy: use strcpy() not sprintf()

2011-07-14 Thread Mike Frysinger
On Thursday, July 14, 2011 09:49:23 Albert ARIBAUD wrote: > Le 14/07/2011 14:31, Laurence Withers a écrit : > > In miiphy_register() the new device's name was initialised by passing a > > string parameter as the format string to sprintf(). As this would cause > > problems if it ever contained a '%'

Re: [U-Boot] [PATCH] miiphy: use strcpy() not sprintf()

2011-07-14 Thread Albert ARIBAUD
Hi Laurence, Le 14/07/2011 14:31, Laurence Withers a écrit : > In miiphy_register() the new device's name was initialised by passing a > string parameter as the format string to sprintf(). As this would cause > problems if it ever contained a '%' symbol, switch to using strcpy() > instead. Please