All of lore.kernel.org
 help / color / mirror / Atom feed
From: Osama Abdelkader <osama.abdelkader@gmail.com>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mips: math-emu: replace deprecated strcpy() in me-debugfs
Date: Tue, 2 Sep 2025 15:29:25 +0200	[thread overview]
Message-ID: <aLbxNfo9Y0QkF1fC@XPS> (raw)
In-Reply-To: <aLbbQ1vwnXYwU6JJ@alpha.franken.de>

On Tue, Sep 02, 2025 at 01:55:47PM +0200, Thomas Bogendoerfer wrote:
> On Mon, Sep 01, 2025 at 03:39:19PM +0200, Osama Abdelkader wrote:
> > use strscpy() instead of deprecated strcpy().
> > 
> > Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com>
> > ---
> >  arch/mips/math-emu/me-debugfs.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/arch/mips/math-emu/me-debugfs.c b/arch/mips/math-emu/me-debugfs.c
> > index d5ad76b2bb67..94667cbe18e7 100644
> > --- a/arch/mips/math-emu/me-debugfs.c
> > +++ b/arch/mips/math-emu/me-debugfs.c
> > @@ -41,7 +41,7 @@ static void adjust_instruction_counter_name(char *out_name, char *in_name)
> >  {
> >  	int i = 0;
> >  
> > -	strcpy(out_name, in_name);
> > +	strscpy(out_name, in_name, sizeof(out_name));
> 
> this is wrong. sizeof(out_name) is the size of the pointer, but not the
> size of the storage behind it. To be able to use strscpy() here you
> need to pass in the size of the given buffer and use that.
> 
> Thomas.
> 

Thanks Thomas, I just sent v2.

Regards,
Osama

> -- 
> Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
> good idea.                                                [ RFC1925, 2.3 ]

      reply	other threads:[~2025-09-02 13:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-01 13:39 [PATCH] mips: math-emu: replace deprecated strcpy() in me-debugfs Osama Abdelkader
2025-09-02 11:55 ` Thomas Bogendoerfer
2025-09-02 13:29   ` Osama Abdelkader [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=aLbxNfo9Y0QkF1fC@XPS \
    --to=osama.abdelkader@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=tsbogend@alpha.franken.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.