Re: [PATCH nf] netfilter: prefer nla_strlcpy for dealing with NLA_STRING attributes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, May 06, 2018 at 12:45:43AM +0200, Florian Westphal wrote:
> fixes these warnings:
> 'nfnl_cthelper_create' at net/netfilter/nfnetlink_cthelper.c:237:2,
> 'nfnl_cthelper_new' at net/netfilter/nfnetlink_cthelper.c:450:9:
> ./include/linux/string.h:246:9: warning: '__builtin_strncpy' specified bound 16 equals destination size [-Wstringop-truncation]
>   return __builtin_strncpy(p, q, size);
>          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Moreover, strncpy assumes null-terminated source buffers, but thats
> not the case here.
> Unlike strlcpy, nla_strlcpy *does* pad the destination buffer
> while also considering nla attribute size.

Also applied, thanks!
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux