linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Norris <briannorris@chromium.org>
To: Dmitry Antipov <dmantipov@yandex.ru>
Cc: Christophe Jaillet <christophe.jaillet@wanadoo.fr>,
	Kalle Valo <kvalo@kernel.org>,
	linux-wireless@vger.kernel.org
Subject: Re: [PATCH 1/2] [v2] wifi: mwifiex: avoid strlcpy() and use strscpy() where appropriate
Date: Wed, 21 Jun 2023 08:39:51 -0700	[thread overview]
Message-ID: <ZJMZx2E1irSNVOEl@google.com> (raw)
In-Reply-To: <ee69ac82-bc62-a288-d7c9-bb432a1b5959@yandex.ru>

On Wed, Jun 21, 2023 at 11:08:46AM +0300, Dmitry Antipov wrote:
> On 6/20/23 19:08, Brian Norris wrote:
> 
> > I'm not sure how a compile-time constant makes this "unsafe" at all, but
> > if you feel the need to change this, then sure, this works too.
> 
> The only reason is to avoid strlcpy() which is now considered deprecated.

Sure, OK.

> > FWIW, this 'firmware' pointer is all derived from compile-time constants
> > too. So the commit messages seems misleading ("all other calls [...]
> > should be safe" --> well, *all* calls are safe).
> 
> Indeed. So I think we can stay with strcpy() everywhere except strlcpy() to strscpy() replacement
> (just to follow https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy rather than
> to fix something).

That works too. It's cool to drop stcrpy() anyway though, since it's
really just a feature of a poor language (C) that we have to reason
about whether any given string operation is "safe" or not. I was just
noting that your commit message reasoning was slightly off.

Brian

      reply	other threads:[~2023-06-21 15:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-20 10:07 [PATCH 1/2] [v2] wifi: mwifiex: avoid strlcpy() and use strscpy() where appropriate Dmitry Antipov
2023-06-20 10:07 ` [PATCH 2/2] [v2] wifi: mwifiex: fix fortify warning Dmitry Antipov
2023-06-20 16:26   ` [PATCH 2/2] [v2] wifi: mwifiex: fix fortify warningg Brian Norris
2023-06-21  8:32     ` Dmitry Antipov
2023-06-21 15:47       ` Brian Norris
2023-06-20 16:08 ` [PATCH 1/2] [v2] wifi: mwifiex: avoid strlcpy() and use strscpy() where appropriate Brian Norris
2023-06-21  8:08   ` Dmitry Antipov
2023-06-21 15:39     ` Brian Norris [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=ZJMZx2E1irSNVOEl@google.com \
    --to=briannorris@chromium.org \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=dmantipov@yandex.ru \
    --cc=kvalo@kernel.org \
    --cc=linux-wireless@vger.kernel.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).