Re: ipset 7.9 compilation fix on kernel 4.14

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

 



Hi,

On Thu, 10 Dec 2020, Ed W wrote:

> There remains a compile warning, just wanted to bring to your attention:
> 
> /var/tmp/portage/net-firewall/ipset-7.9/work/ipset-7.9/kernel/net/netfilter/ips
> et/ip_set_core.c: In function 'ip_set_rename':
> /var/tmp/portage/net-firewall/ipset-7.9/work/ipset-7.9/kernel/net/netfilter/ips
> et/ip_set_core.c:1359:2: warning: 'strncpy' specified bound 32 equals
> destination size [-Wstringop-truncation]
>  1359 |  strncpy(set->name, name2, IPSET_MAXNAMELEN);
>       |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   LD [M] /var/tmp/portage/net-firewall/ipset-7.9/work/ipset-7.9/kernel/net/netfilter/ips
> et/ip_set.o

That's a false warning: name2 comes from a netlink attribute which size 
is limited to IPSET_MAXNAMELEN-1, including NUL. The compiler can't figure 
it out though.

Best regards,
Jozsef
-
E-mail  : kadlec@xxxxxxxxxxxxxxxxx, kadlecsik.jozsef@xxxxxxxxx
PGP key : https://wigner.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics
          H-1525 Budapest 114, POB. 49, Hungary

[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux