lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <A0877360-6B98-48F3-9A6C-398AAD12F3B5@linux.dev>
Date: Tue, 18 Mar 2025 23:50:03 +0100
From: Thorsten Blum <thorsten.blum@...ux.dev>
To: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
 Christian Brauner <brauner@...nel.org>,
 "Liam R. Howlett" <Liam.Howlett@...cle.com>,
 Suren Baghdasaryan <surenb@...gle.com>,
 Wei Yang <richard.weiyang@...il.com>,
 David Hildenbrand <david@...hat.com>,
 Miaohe Lin <linmiaohe@...wei.com>,
 Al Viro <viro@...iv.linux.org.uk>,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fork: Remove unnecessary size argument when calling
 strscpy()

On 11. Mar 2025, at 12:13, Lorenzo Stoakes wrote:
> On Tue, Mar 11, 2025 at 12:05:39PM +0100, Thorsten Blum wrote:
>> The size parameter is optional and strscpy() automatically determines
>> the length of the destination buffer using sizeof() if the argument is
>> omitted. This makes the explicit sizeof() unnecessary. Remove it to
>> simplify the code.
>> 
>> Signed-off-by: Thorsten Blum <thorsten.blum@...ux.dev>
> 
> Hm not sure about this one, it's not really simplifying anything all too
> much and seems like somewhat useless churn?
> 
> It's pretty clear what's going on here already.

Yes, but explicitly specifying the default value for an optional
parameter is redundant, and omitting it simplifies the code.

Thanks,
Thorsten


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ