[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wjsM9cUHfmGMcco5zCuBqMpM-97hBkBX5_vzoRLm5SvJw@mail.gmail.com>
Date: Tue, 2 Aug 2022 15:11:18 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Casey Schaufler <casey@...aufler-ca.com>
Cc: LSM List <linux-security-module@...r.kernel.org>,
Linux kernel mailing list <linux-kernel@...r.kernel.org>
Subject: Re: [GIT PULL] Smack patches for v6.0
On Mon, Aug 1, 2022 at 1:13 PM Casey Schaufler <casey@...aufler-ca.com> wrote:
>
> There are two minor code clean-ups. One removes a touch of
> dead code and the other replaces an instance of kzalloc + strncpy
> with kstrndup.
Hmm. That second one looks like it really should have just used
"kmemdup()" (and a zero termination) instead, since it has already
done all the string length calculations.
Oh well. I guess the strndup() works too, but it seems kind of odd to
do a strnlen() there when you have literally limited 'len' to smaller
than the string you are going to duplicate.
Linus
Powered by blists - more mailing lists