summaryrefslogtreecommitdiff
path: root/net/tipc/socket.c
diff options
context:
space:
mode:
authorGuoqing Jiang <gqjiang@suse.com>2018-10-19 07:08:22 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-12-08 15:03:41 +0300
commit88b58409f82e98d28f90328fa9ab98e0de479a0c (patch)
tree18c2bbb6af0b66b4dba3fadf473f51059d6865a7 /net/tipc/socket.c
parent02dc68829e5f2a9b48829725f332200ac3b051c2 (diff)
downloadlinux-88b58409f82e98d28f90328fa9ab98e0de479a0c.tar.xz
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>
Diffstat (limited to 'net/tipc/socket.c')
0 files changed, 0 insertions, 0 deletions