[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <01bf49ea-8461-4961-bc9f-893ce59a3d2a@acm.org>
Date: Tue, 18 Feb 2025 10:11:34 -0800
From: Bart Van Assche <bvanassche@....org>
To: Thorsten Blum <thorsten.blum@...ux.dev>,
Don Brace <don.brace@...rochip.com>,
"James E.J. Bottomley" <James.Bottomley@...senPartnership.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>
Cc: linux-hardening@...r.kernel.org, Kees Cook <kees@...nel.org>,
David Laight <david.laight.linux@...il.com>, storagedev@...rochip.com,
linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] scsi: hpsa: Remove deprecated and unnecessary
strncpy()
On 2/14/25 3:43 AM, Thorsten Blum wrote:
> While replacing strncpy() with strscpy(), Bart Van Assche pointed out
> that the code occurs inside sysfs write callbacks, which already uses
> NUL-terminated strings. This allows the string to be passed directly to
> sscanf() without requiring a temporary copy.
>
> Remove the deprecated and unnecessary strncpy() and the corresponding
> local variables, and pass the buffer buf directly to sscanf().
>
> Replace sscanf() with kstrtoint() to silence checkpatch warnings.
Reviewed-by: Bart Van Assche <bvanassche@....org>
Powered by blists - more mailing lists