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

Mike Frysinger vapier at gentoo.org
Thu Jul 14 20:02:42 CEST 2011


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 '%' symbol, switch to using strcpy()
> > instead.
> 
> Please use strncpy() which will also guard against overflows.

or BUG_ON(strlen(name) >= MDIO_NAME_LEN)
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110714/60a4ff1d/attachment.pgp 


More information about the U-Boot mailing list