From: Mike Frysinger Date: Thu, 14 Jul 2011 14:02:42 -0400 Subject: [U-Boot] [PATCH] miiphy: use strcpy() not sprintf() In-Reply-To: <4E1EF3E3.8090600@aribaud.net> References: <1310646667-2426-1-git-send-email-lwithers@guralp.com> <4E1EF3E3.8090600@aribaud.net> Message-ID: <201107141402.43091.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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