Re: [PATCH net-next] macvlan: Replace strncpy() by strscpy()
From: David Miller
Date: Wed May 29 2019 - 03:03:41 EST
From: "Gustavo A. R. Silva" <gustavo@xxxxxxxxxxxxxx>
Date: Mon, 27 May 2019 13:38:55 -0500
> The strncpy() function is being deprecated. Replace it by the safer
> strscpy() and fix the following Coverity warning:
>
> "Calling strncpy with a maximum size argument of 16 bytes on destination
> array ifrr.ifr_ifrn.ifrn_name of size 16 bytes might leave the destination
> string unterminated."
>
> Notice that, unlike strncpy(), strscpy() always null-terminates the
> destination string.
>
> Addresses-Coverity-ID: 1445537 ("Buffer not null terminated")
> Signed-off-by: Gustavo A. R. Silva <gustavo@xxxxxxxxxxxxxx>
Applied.