]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: replace strncpy with strlcpy in dplane
authorMark Stapp <mjs@voltanet.io>
Thu, 2 May 2019 13:52:48 +0000 (09:52 -0400)
committerMark Stapp <mjs@voltanet.io>
Thu, 2 May 2019 13:52:48 +0000 (09:52 -0400)
The dataplane module picked up a couple of strncpys; replace
them.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
zebra/zebra_dplane.c

index d1b28227c37d7f78cd14e123691a18bd03b16030..e6671bd87cef7e99bc9a7c18594eb5724851a5ec 100644 (file)
@@ -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 {