android_kernel_oneplus_msm8998/net/tipc
Guoqing Jiang ae46de2430 tipc: use destination length for copy string
commit 29e270fc32192e7729057963ae7120663856c93e upstream.

Got below warning with gcc 8.2 compiler.

net/tipc/topsrv.c: In function ‘tipc_topsrv_start’:
net/tipc/topsrv.c:660:2: warning: ‘strncpy’ specified bound depends on the length of the source argument [-Wstringop-overflow=]
  strncpy(srv->name, name, strlen(name) + 1);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/tipc/topsrv.c:660:27: note: length computed here
  strncpy(srv->name, name, strlen(name) + 1);
                           ^~~~~~~~~~~~
So change it to correct length and use strscpy.

Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Acked-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-20 10:13:14 +01:00
..
addr.c
addr.h
bcast.c tipc: unlock in error path 2016-03-03 15:07:07 -08:00
bcast.h tipc: clean up unused code and structures 2015-10-24 06:56:47 -07:00
bearer.c tipc: check minimum bearer MTU 2017-04-30 05:49:28 +02:00
bearer.h tipc: check minimum bearer MTU 2017-04-30 05:49:28 +02:00
core.c tipc: make dist queue pernet 2017-04-30 05:49:27 +02:00
core.h tipc: make dist queue pernet 2017-04-30 05:49:27 +02:00
discover.c tipc: let neighbor discoverer tranmsit consumable buffers 2015-10-24 06:56:44 -07:00
discover.h
eth_media.c
ib_media.c
Kconfig
link.c tipc: fix link attribute propagation bug 2017-11-18 11:11:07 +01:00
link.h tipc: fix link attribute propagation bug 2017-11-18 11:11:07 +01:00
Makefile
msg.c tipc: use only positive error codes in messages 2017-10-21 17:09:03 +02:00
msg.h tipc: let broadcast packet reception use new link receive function 2015-10-24 06:56:37 -07:00
name_distr.c tipc: fix random link resets while adding a second bearer 2017-04-30 05:49:28 +02:00
name_distr.h
name_table.c
name_table.h
net.c tipc: add policy for TIPC_NLA_NET_ADDR 2018-04-29 07:50:06 +02:00
net.h
netlink.c
netlink.h
netlink_compat.c tipc: fix uninit-value in tipc_nl_compat_doit 2019-01-26 09:42:51 +01:00
node.c tipc: correct error in node fsm 2017-04-30 05:49:27 +02:00
node.h tipc: clean up unused code and structures 2015-10-24 06:56:47 -07:00
server.c tipc: fix memory leak in tipc_accept_from_sock() 2017-12-16 10:33:56 +01:00
server.h
socket.c tipc: fix socket timer deadlock 2017-04-30 05:49:28 +02:00
socket.h
subscr.c tipc: use destination length for copy string 2019-02-20 10:13:14 +01:00
subscr.h
sysctl.c
udp_media.c tipc: check minimum bearer MTU 2017-04-30 05:49:28 +02:00