From 1d7490bc7cc96fb601e542d2287e5398201bb0f1 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 11 Jan 2019 12:35:14 -0800 Subject: [PATCH] net/tap: use strlcpy for interface name snprintf is not needed here, use strlcpy instead. Signed-off-by: Stephen Hemminger Acked-by Keith Wiles --- drivers/net/tap/rte_eth_tap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index 0ec030bef6..1c00681ba0 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -148,7 +148,7 @@ tun_alloc(struct pmd_internals *pmd, int is_keepalive) */ ifr.ifr_flags = (pmd->type == ETH_TUNTAP_TYPE_TAP) ? IFF_TAP : IFF_TUN | IFF_POINTOPOINT; - snprintf(ifr.ifr_name, IFNAMSIZ, "%s", pmd->name); + strlcpy(ifr.ifr_name, pmd->name, IFNAMSIZ); TAP_LOG(DEBUG, "ifr_name '%s'", ifr.ifr_name); -- 2.20.1