From: Krzysztof Kozlowski <krzk@kernel.org>
To: Thorsten Blum <thorsten.blum@linux.dev>,
Huisong Li <lihuisong@huawei.com>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] w1: therm: Replace deprecated strcpy with strscpy in alarms_store
Date: Mon, 20 Oct 2025 09:01:08 +0200 [thread overview]
Message-ID: <db33871a-26ad-44f2-8e4b-046aa34f6477@kernel.org> (raw)
In-Reply-To: <20251017170047.114224-2-thorsten.blum@linux.dev>
On 17/10/2025 19:00, Thorsten Blum wrote:
> strcpy() is deprecated because it can overflow when the destination
> buffer is not large enough for the source string. Replace it with
It cannot overflow. Look at the code - memory is allocated for the size.
> strscpy(), which avoids overflows and guarantees NUL-termination.
Maybe NUL-termination is missing, could be.
Anyway please write commit msg describing this exact code, not a generic
one for work replacing strcpy(). Your generic commit msg is just not
applicable here.
And even there, just look at the code - why exactly cannot it be
simplified into ksrtdup?
Best regards,
Krzysztof
next prev parent reply other threads:[~2025-10-20 7:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-17 17:00 [PATCH] w1: therm: Replace deprecated strcpy with strscpy in alarms_store Thorsten Blum
2025-10-20 7:01 ` Krzysztof Kozlowski [this message]
2025-10-21 21:22 ` Thorsten Blum
2025-10-22 16:50 ` David Laight
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=db33871a-26ad-44f2-8e4b-046aa34f6477@kernel.org \
--to=krzk@kernel.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=lihuisong@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=thorsten.blum@linux.dev \
/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