From: Andy Green Date: Mon, 14 May 2018 05:00:22 +0000 (+0800) Subject: net/nfp: fix strncpy misuse X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=01077fa9ac9c320e84b85f2965056b926401b316;p=dpdk.git net/nfp: fix strncpy misuse Fixes: c7e9729da6b5 ("net/nfp: support CPP") Signed-off-by: Andy Green Acked-by: Alejandro Lucero Tested-by: Alejandro Lucero --- diff --git a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c index 4e6c66624a..52b2948889 100644 --- a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c +++ b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c @@ -31,6 +31,8 @@ #include #include +#include + #include "nfp_cpp.h" #include "nfp_target.h" #include "nfp6000/nfp6000.h" @@ -846,7 +848,7 @@ nfp6000_init(struct nfp_cpp *cpp, const char *devname) memset(desc->busdev, 0, BUSDEV_SZ); - strncpy(desc->busdev, devname, strlen(devname)); + strlcpy(desc->busdev, devname, sizeof(desc->busdev)); ret = nfp_acquire_process_lock(desc); if (ret)