grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: "Lennart Sorensen" <lsorense@csclub.uwaterloo.ca>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: [PATCH 3/7] Initial support for U-Boot platforms
Date: Wed, 3 Apr 2013 14:05:39 -0400	[thread overview]
Message-ID: <20130403180539.GI21768@csclub.uwaterloo.ca> (raw)
In-Reply-To: <20130403162451.GK23069@rocoto.smurfnet.nu>

On Wed, Apr 03, 2013 at 04:24:51PM +0000, Leif Lindholm wrote:
> Because I am an overtly paranoid person. :)

That's not paranoid.  That's just inefficient.  The length argument has
to be based on the target size, NOT the length of the source.  If you want
to length of the source, that's what plain old strcpy does by definition.

I just found some of those in some other code I was cleaning up and
wasn't pleased with them there.  Just because it says strncpy doesn't
mean what you are doing is any safer than strcpy if you do it wrong.

-- 
Len Sorensen


  reply	other threads:[~2013-04-03 18:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-24 17:01 [PATCH 3/7] Initial support for U-Boot platforms Leif Lindholm
2013-03-30 16:20 ` Francesco Lavra
2013-03-30 16:43   ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-04-03 16:24   ` Leif Lindholm
2013-04-03 18:05     ` Lennart Sorensen [this message]
2013-04-03 19:59       ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-04-01  2:08 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-04-03 16:17   ` Leif Lindholm
2013-04-08 10:49     ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-04-09 10:37       ` Leif Lindholm
2013-04-09 11:29         ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-05-02 19:25   ` Vladimir 'φ-coder/phcoder' Serbinenko

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=20130403180539.GI21768@csclub.uwaterloo.ca \
    --to=lsorense@csclub.uwaterloo.ca \
    --cc=grub-devel@gnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).