From mboxrd@z Thu Jan 1 00:00:00 1970 From: Reshma Pattan Subject: [PATCH 2/4] net/softnic: fix string copy Date: Tue, 30 Oct 2018 14:22:50 +0000 Message-ID: <1540909372-23110-2-git-send-email-reshma.pattan@intel.com> References: <1540909372-23110-1-git-send-email-reshma.pattan@intel.com> Cc: Reshma Pattan , cristian.dumitrescu@intel.com, jasvinder.singh@intel.com To: dev@dpdk.org Return-path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 6738410A3 for ; Tue, 30 Oct 2018 15:22:58 +0100 (CET) In-Reply-To: <1540909372-23110-1-git-send-email-reshma.pattan@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Reshma Pattan Replace strcpy with strlcpy to avoid buffer overrun. Coverity issue: 323515 Fixes: b767f8efc8 ("net/softnic: replace pointers with arrays") CC: cristian.dumitrescu@intel.com CC: jasvinder.singh@intel.com Signed-off-by: Reshma Pattan --- drivers/net/softnic/rte_eth_softnic_cli.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/softnic/rte_eth_softnic_cli.c b/drivers/net/softnic/rte_eth_softnic_cli.c index 2235b07e8..a0beca904 100644 --- a/drivers/net/softnic/rte_eth_softnic_cli.c +++ b/drivers/net/softnic/rte_eth_softnic_cli.c @@ -2485,7 +2485,8 @@ cmd_pipeline_table(struct pmd_internals *softnic, return; } - strcpy(p.action_profile_name, tokens[t0 + 1]); + strlcpy(p.action_profile_name, tokens[t0 + 1], + sizeof(p.action_profile_name)); t0 += 2; } -- 2.17.1