Re: [PATCH] kdb: replace deprecated strncpy

From: Justin Stitt
Date: Wed Apr 03 2024 - 13:54:54 EST


On Wed, Apr 3, 2024 at 4:23 AM Daniel Thompson
<daniel.thompson@xxxxxxxxxx> wrote:
> > - strncpy(cp, p_tmp+len, len_tmp-len + 1);
> > + memcpy(cp, p_tmp+len, len_tmp-len + 1);
>
> Roughly the same question here. The original coded is obviously wrong
> so trusting it did the boundary checks properly seems unwise.
>
> Are you sure it is OK to make this copy with checking against bufend?
>

I am going to revisit this and find a better solution. Thanks Daniel.

>
> Daniel.