From b7b7bf31da5ae8e3a13827b3ab14e4e113ce6fe6 Mon Sep 17 00:00:00 2001 From: Mark Stapp Date: Thu, 2 May 2019 09:52:48 -0400 Subject: [PATCH] zebra: replace strncpy with strlcpy in dplane The dataplane module picked up a couple of strncpys; replace them. Signed-off-by: Mark Stapp --- zebra/zebra_dplane.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index d1b28227c3..e6671bd87c 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -1706,7 +1706,7 @@ static enum zebra_dplane_result intf_addr_update_internal( /* Init the interface-addr-specific area */ memset(&ctx->u.intf, 0, sizeof(ctx->u.intf)); - strncpy(ctx->u.intf.ifname, ifp->name, sizeof(ctx->u.intf.ifname)); + strlcpy(ctx->u.intf.ifname, ifp->name, sizeof(ctx->u.intf.ifname)); ctx->u.intf.ifindex = ifp->ifindex; ctx->u.intf.prefix = *(ifc->address); @@ -1734,7 +1734,7 @@ static enum zebra_dplane_result intf_addr_update_internal( len = strlen(ifc->label); if (len < sizeof(ctx->u.intf.label_buf)) { - strncpy(ctx->u.intf.label_buf, ifc->label, + strlcpy(ctx->u.intf.label_buf, ifc->label, sizeof(ctx->u.intf.label_buf)); ctx->u.intf.label = ctx->u.intf.label_buf; } else { -- 2.39.5