archive mirror
 help / color / mirror / Atom feed
From: Len Baker <>
To: Jonathan Cameron <>
Cc: Len Baker <>, Kees Cook <>,
	Lars-Peter Clausen <>,,,
Subject: Re: [PATCH] drivers/iio: Remove all strcpy() uses in favor of strscpy()
Date: Sat, 7 Aug 2021 17:02:06 +0200	[thread overview]
Message-ID: <20210807141711.GC2688@titan> (raw)
In-Reply-To: <20210801205528.211c4e9c@jic23-huawei>


On Sun, Aug 01, 2021 at 08:55:28PM +0100, Jonathan Cameron wrote:
> On Sun,  1 Aug 2021 19:11:57 +0200
> Len Baker <> wrote:
> > strcpy() performs no bounds checking on the destination buffer. This
> > could result in linear overflows beyond the end of the buffer, leading
> > to all kinds of misbehaviors. The safe replacement is strscpy().
> >
> > Signed-off-by: Len Baker <>
> Hi Len,
> I'm not convinced this is terribly useful in this particular case.
> As the code stands today, it is easy to verify that the buffer is
> large enough by looking up a few lines. As you need to do that
> anyway to check that n, n -1 in the strscpy is correct, what do we gain?
> I don't mind this if it's part of a general removal of strcpy(), but
> if so the patch description should state that.

Ok, I will send a new version with the commit changelog updated.


      reply	other threads:[~2021-08-07 15:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-01 17:11 Len Baker
2021-08-01 19:55 ` Jonathan Cameron
2021-08-07 15:02   ` Len Baker [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:

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

  git send-email \
    --in-reply-to=20210807141711.GC2688@titan \ \ \ \ \ \ \ \
    --subject='Re: [PATCH] drivers/iio: Remove all strcpy() uses in favor of strscpy()' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).