[dpdk-stable] [dpdk-dev] [PATCH 1/2] bus/dpaa: fix build with gcc 9.0
Bruce Richardson
bruce.richardson at intel.com
Thu Nov 1 18:45:50 CET 2018
On Thu, Nov 01, 2018 at 10:42:31AM -0700, Stephen Hemminger wrote:
> On Thu, 1 Nov 2018 13:19:50 +0000
> Ferruh Yigit <ferruh.yigit at intel.com> wrote:
>
> > build error:
> > In function ‘fman_if_init’,
> > .../drivers/bus/dpaa/base/fman/fman.c:186:2:
> > error: ‘strncpy’ output may be truncated copying 4095 bytes from a
> > string of length 4095 [-Werror=stringop-truncation]
> > strncpy(__if->node_path, dpa_node->full_name, PATH_MAX - 1);
> >
> > strncpy may result a not null-terminated string,
> > replaced it with rte_strscpy
> >
> > Fixes: 5b22cf744689 ("bus/dpaa: introducing FMan configurations")
> > Cc: stable at dpdk.org
> >
> > Signed-off-by: Ferruh Yigit <ferruh.yigit at intel.com>
>
> Maybe just use strlcpy instead of a DPDK specific function.
> That way if Gcc gets smarter it can check that as well.
+1
While I get the point of strscpy, if strlcpy is good enough for openbsd,
it's good enough for me! :-)
More information about the stable
mailing list