[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a1+_o5HC8uU+9p_Wv9NXtXzn0Mp3s+hrpofgfR1wT1mOA@mail.gmail.com>
Date: Mon, 26 Oct 2020 17:40:49 +0100
From: Arnd Bergmann <arnd@...nel.org>
To: Arvind Sankar <nivedita@...m.mit.edu>
Cc: Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
Thierry Reding <treding@...dia.com>,
Timo Alho <talho@...dia.com>,
"open list:TEGRA ARCHITECTURE SUPPORT" <linux-tegra@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] firmware: tegra: fix strncpy()/strncat() confusion
On Mon, Oct 26, 2020 at 5:35 PM Arvind Sankar <nivedita@...m.mit.edu> wrote:
> > diff --git a/drivers/firmware/tegra/bpmp-debugfs.c b/drivers/firmware/tegra/bpmp-debugfs.c
> > index c1bbba9ee93a..9ec20ddc9a6b 100644
> > --- a/drivers/firmware/tegra/bpmp-debugfs.c
> > +++ b/drivers/firmware/tegra/bpmp-debugfs.c
> > @@ -412,16 +412,12 @@ static int bpmp_populate_debugfs_inband(struct tegra_bpmp *bpmp,
> > goto out;
> > }
> >
> > - len = strlen(ppath) + strlen(name) + 1;
> > + len = snprintf("%s%s/", pathlen, ppath, name);
>
> Didn't you get any warnings with this? It should be
> len = snprintf(pathbuf, pathlen, "%s%s/", ppath, name);
> right?
>
Eek, I did get a warning about a different issue in that one-line change and
fixed it up in the wrong way without testing again. Sorry about that.
I'll retest and resend.
Arnd
Powered by blists - more mailing lists