]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: ipset: replace a strncpy() with strscpy()
authorQian Cai <cai@gmx.us>
Mon, 10 Dec 2018 13:39:38 +0000 (14:39 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 13 Dec 2018 23:04:08 +0000 (00:04 +0100)
commit0e13ac3d2624a5c6e386917e8743e7f0886677c9
tree0268ded5f01db33551c33bfe4a5e61ce4b0315ad
parent19a812e65248912c5d2347db8ba5829e45b9e812
netfilter: ipset: replace a strncpy() with strscpy()

To make overflows as obvious as possible and to prevent code from blithely
proceeding with a truncated string. This also has a side-effect to fix a
compilation warning when using GCC 8.2.1.

net/netfilter/ipset/ip_set_core.c: In function 'ip_set_sockfn_get':
net/netfilter/ipset/ip_set_core.c:2027:3: warning: 'strncpy' writing 32 bytes into a region of size 2 overflows the destination [-Wstringop-overflow=]

Signed-off-by: Qian Cai <cai@gmx.us>
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/ipset/ip_set_core.c