From: Laurence Withers <lwithers@guralp.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] miiphy: use strcpy() not sprintf()
Date: Fri, 15 Jul 2011 09:21:24 +0000 [thread overview]
Message-ID: <20110715092123.GC5891@guralp.com> (raw)
In-Reply-To: <201107141402.43091.vapier@gentoo.org>
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 for the name
overflowing but BUG_ON() is IMO clearer so I switched to using it instead. I
kept strncpy() in v3, rather than just strcpy(), because it makes the code
robust against future edits. Thanks for the feedback.
Bye for now,
--
Laurence Withers, <lwithers@guralp.com> http://www.guralp.com/
Direct tel:+447753988197 or tel:+443333408643 Software Engineer
General support queries: <support@guralp.com> CMG-DCM CMG-EAM CMG-NAM
prev parent reply other threads:[~2011-07-15 9:21 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
2011-07-15 9:21 ` Laurence Withers [this message]
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=20110715092123.GC5891@guralp.com \
--to=lwithers@guralp.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.