public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
From: Len Baker <len.baker@gmx.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Len Baker <len.baker@gmx.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Nikolay Kyx <knv418@gmail.com>,
	Aditya Srivastava <yashsri421@gmail.com>,
	Jiapeng Chong <jiapeng.chong@linux.alibaba.com>,
	William Durand <will+git@drnd.me>,
	Romain Perier <romain.perier@gmail.com>,
	Allen Pais <apais@linux.microsoft.com>,
	Phillip Potter <phil@philpotter.co.uk>,
	zhaoxiao <zhaoxiao@uniontech.com>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging/rtl8192e: Remove all strcpy() uses in favor of strscpy()
Date: Fri, 23 Jul 2021 18:30:40 +0200	[thread overview]
Message-ID: <20210723152559.GC2612@titan> (raw)
In-Reply-To: <20210719054345.GO1931@kadam>

Hi,

On Mon, Jul 19, 2021 at 08:43:45AM +0300, Dan Carpenter wrote:
> On Sun, Jul 18, 2021 at 11:06:36AM +0200, Len Baker wrote:
> > diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c
> > index f89799d43b1b..5968407c646d 100644
> > --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c
> > +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c
> > @@ -543,7 +543,7 @@ int rtllib_wx_get_name(struct rtllib_device *ieee,
> >  			     struct iw_request_info *info,
> >  			     union iwreq_data *wrqu, char *extra)
> >  {
> > -	strcpy(wrqu->name, "802.11");
> > +	strscpy(wrqu->name, "802.11", sizeof(wrqu->name));
> >
> >  	if (ieee->modulation & RTLLIB_CCK_MODULATION)
> >  		strcat(wrqu->name, "b");
>
> This patch is just about silencing inferior static analysis tools,
> right?  Most checkers can figure out the size of the array and verify
> that it has space for "802.11".  Probably it's only raw grep which
> can't.
>
> It doesn't make sense to me that we have strscpy() followed by strcat.
> So let's fix both.

Ok, I will send a v2 for review. Thanks for the feedback.

>
> regards,
> dan carpenter

Regards,
Len

      reply	other threads:[~2021-07-23 16:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-18  9:06 [PATCH] staging/rtl8192e: Remove all strcpy() uses in favor of strscpy() Len Baker
2021-07-19  5:43 ` Dan Carpenter
2021-07-23 16:30   ` 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:
  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=20210723152559.GC2612@titan \
    --to=len.baker@gmx.com \
    --cc=apais@linux.microsoft.com \
    --cc=dan.carpenter@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jiapeng.chong@linux.alibaba.com \
    --cc=knv418@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=phil@philpotter.co.uk \
    --cc=romain.perier@gmail.com \
    --cc=will+git@drnd.me \
    --cc=yashsri421@gmail.com \
    --cc=zhaoxiao@uniontech.com \
    /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