From: Thorsten Blum <thorsten.blum@linux.dev>
To: David Laight <david.laight.linux@gmail.com>
Cc: Namjae Jeon <linkinjeon@kernel.org>,
Steve French <smfrench@gmail.com>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Tom Talpey <tom@talpey.com>,
linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ksmbd: Replace strcpy + strcat with scnprintf in convert_to_nt_pathname
Date: Wed, 19 Nov 2025 02:23:01 +0100 [thread overview]
Message-ID: <620FC0E4-E745-429B-BF16-BCC2D5924E1D@linux.dev> (raw)
In-Reply-To: <20251118223513.241aed65@pumpkin>
On 18. Nov 2025, at 23:35, David Laight wrote:
> On Tue, 18 Nov 2025 13:25:56 +0100
> Thorsten Blum <thorsten.blum@linux.dev> wrote:
>
>> strcpy() is deprecated and using strcat() is discouraged; use the safer
>> scnprintf() instead. No functional changes.
>>
>> Link: https://github.com/KSPP/linux/issues/88
>> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
>> ---
>> [...]
>
> Ugg...
> If nothing else non-constant formats are definitely frowned upon.
> Never mind the non-trivial cpu cost of printf.
>
> OTOH once you've got the string length, just use memcpy().
> That way you know you won't overflow the malloc buffer even
> if someone changes the string on you.
Ok, I'll submit a v2.
Thanks,
Thorsten
prev parent reply other threads:[~2025-11-19 1:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-18 12:25 Thorsten Blum
2025-11-18 22:35 ` David Laight
2025-11-19 1:23 ` Thorsten Blum [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=620FC0E4-E745-429B-BF16-BCC2D5924E1D@linux.dev \
--to=thorsten.blum@linux.dev \
--cc=david.laight.linux@gmail.com \
--cc=linkinjeon@kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=senozhatsky@chromium.org \
--cc=smfrench@gmail.com \
--cc=tom@talpey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®