[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202409170130.C9F169D4@keescook>
Date: Tue, 17 Sep 2024 01:30:32 -0700
From: Kees Cook <kees@...nel.org>
To: Abdul Rahim <abdul.rahim@...ahoo.com>
Cc: gregkh@...uxfoundation.org, m.grzeschik@...gutronix.de,
quic_jjohnson@...cinc.com, gustavoars@...nel.org,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] usb: gadget: f_midi: prefer strscpy() over strcpy()
On Sun, Sep 15, 2024 at 04:47:49AM +0530, Abdul Rahim wrote:
> The function strcpy() is depreciated and potentially unsafe. It performs
> no bounds checking on the destination buffer. This could result in
> linear overflows beyond the end of the buffer, leading to all kinds of
> misbehaviors. The safe replacement is strscpy() [1].
>
> this fixes checkpatch warning:
> WARNING: Prefer strscpy over strcpy
>
> Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strcpy [1]
> Signed-off-by: Abdul Rahim <abdul.rahim@...ahoo.com>
Yup, these look good. Thanks!
Reviewed-by: Kees Cook <kees@...nel.org>
--
Kees Cook
Powered by blists - more mailing lists