From: Guoqing Jiang <[email protected]> Date: Fri, 19 Oct 2018 12:08:22 +0800
> 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 <[email protected]> Applied. _______________________________________________ tipc-discussion mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tipc-discussion
