linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Zhang <stephenzhangzsd@gmail.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/memfd: replace strcpy() by strscpy()
Date: Sun, 24 Jan 2021 12:36:12 +0800	[thread overview]
Message-ID: <CALuz2=cWUEo919CO8AFxhCrick3wfBb4T5eWc5tQyNmDafMXSQ@mail.gmail.com> (raw)
In-Reply-To: <20210124040656.GB308988@casper.infradead.org>

[-- Attachment #1: Type: text/plain, Size: 521 bytes --]

Thanks for your suggestions. I just thought both of them are better than
the deprecated strcpy().
Should I resubmit the patch after making changes or just leave it as it
originally is?

Matthew Wilcox <willy@infradead.org> 于2021年1月24日周日 下午12:08写道:

> On Sun, Jan 24, 2021 at 10:23:37AM +0800, Stephen Zhang wrote:
> > -     strcpy(name, MFD_NAME_PREFIX);
> > +     strscpy(name, MFD_NAME_PREFIX, len + MFD_NAME_PREFIX_LEN);
>
> This is silly.  Use memcpy() if you must remove strcpy.
>

[-- Attachment #2: Type: text/html, Size: 828 bytes --]

      reply	other threads:[~2021-01-24  4:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-24  2:23 Stephen Zhang
2021-01-24  4:06 ` Matthew Wilcox
2021-01-24  4:36   ` Stephen Zhang [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='CALuz2=cWUEo919CO8AFxhCrick3wfBb4T5eWc5tQyNmDafMXSQ@mail.gmail.com' \
    --to=stephenzhangzsd@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.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