public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] miiphy: use strcpy() not sprintf()
Date: Thu, 14 Jul 2011 14:02:42 -0400	[thread overview]
Message-ID: <201107141402.43091.vapier@gentoo.org> (raw)
In-Reply-To: <4E1EF3E3.8090600@aribaud.net>

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 

  reply	other threads:[~2011-07-14 18:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-14 12:31 [U-Boot] [PATCH] miiphy: use strcpy() not sprintf() Laurence Withers
2011-07-14 13:49 ` Albert ARIBAUD
2011-07-14 18:02   ` Mike Frysinger [this message]
2011-07-15  9:21     ` Laurence Withers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201107141402.43091.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox