net/nfp: fix off-by-one and no nul on strncpy use
authorAndy Green <andy@warmcat.com>
Mon, 14 May 2018 05:00:27 +0000 (13:00 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 14 May 2018 21:32:23 +0000 (23:32 +0200)
commit62280b7819d24643e70a1428191288133d3d7235
tree77c54c5a888d238c9b3081be2b0fb7e392c0c904
parent01077fa9ac9c320e84b85f2965056b926401b316
net/nfp: fix off-by-one and no nul on strncpy use

drivers/net/nfp/nfpcore/nfp_resource.c:76:2:error:
‘strncpy’ output may be truncated copying 8 bytes from a string of length 8
[-Werror=stringop-truncation]
  strncpy(name_pad, res->name, sizeof(name_pad));

Fixes: c7e9729da6b5 ("net/nfp: support CPP")

Signed-off-by: Andy Green <andy@warmcat.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
drivers/net/nfp/nfpcore/nfp_resource.c