[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <163212570006.110243.10080683787518372101.b4-ty@canonical.com>
Date: Mon, 20 Sep 2021 10:15:04 +0200
From: Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>
To: Jason Wang <wangborong@...rlc.com>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>,
linux-arm-kernel@...ts.infradead.org,
linux-samsung-soc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux@...linux.org.uk
Subject: Re: [PATCH] ARM: s3c: Use strscpy to replace strlcpy
On Mon, 6 Sep 2021 21:46:56 +0800, Jason Wang wrote:
> The strlcpy should not be used because it doesn't limit the source
> length. As linus says, it's a completely useless function if you
> can't implicitly trust the source string - but that is almost always
> why people think they should use it! All in all the BSD function
> will lead some potential bugs.
>
> But the strscpy doesn't require reading memory from the src string
> beyond the specified "count" bytes, and since the return value is
> easier to error-check than strlcpy()'s. In addition, the implementation
> is robust to the string changing out from underneath it, unlike the
> current strlcpy() implementation.
>
> [...]
Applied, thanks!
[1/1] ARM: s3c: Use strscpy to replace strlcpy
commit: aa519471715ce73034ffaa52fc85681de31c1acf
Best regards,
--
Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>
Powered by blists - more mailing lists