Re: [PATCH] string: use strnlen in strlcat

From: Manuel Ebner

Date: Mon May 04 2026 - 08:27:18 EST


On Sat, 2026-05-02 at 11:37 +0300, Andy Shevchenko wrote:
> On Fri, May 01, 2026 at 11:55:33AM +0300, Andy Shevchenko wrote:
> > On Thu, Apr 30, 2026 at 11:53 PM Thorsten Blum <thorsten.blum@xxxxxxxxx>
> > wrote:
> > >
> > > Use strnlen() to limit the destination scan to the provided buffer size.
> > > Remove the redundant comment.
> >
> > Please, do not spend time on amending strlcat(). This function must
> > die. Instead, convert current users to use alternative ways.
>
> Note, there is a patch by Kees to address this in partitions framework
> (vast of the users of strlcat() in the kernel). Not sure if it's already
> pending in Linux Next or not yet.
>
> I have done a simple one in ACPI recently (in upstream already I believe).
> So, you can use those two examples and continue killing strlcat().

Hi,
i would like to add this to the file Documentation/process/deprecated.rst.
Does right after strlcpy() make sense?

Could you point me to the examples?

Thanks
Manuel