From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id BF7004CE4 for ; Tue, 30 Oct 2018 15:22:59 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Oct 2018 07:22:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,444,1534834800"; d="scan'208";a="82092125" Received: from sivswdev02.ir.intel.com (HELO localhost.localdomain) ([10.237.217.46]) by fmsmga007.fm.intel.com with ESMTP; 30 Oct 2018 07:22:58 -0700 From: Reshma Pattan To: dev@dpdk.org Cc: Reshma Pattan , cristian.dumitrescu@intel.com, jasvinder.singh@intel.com Date: Tue, 30 Oct 2018 14:22:51 +0000 Message-Id: <1540909372-23110-3-git-send-email-reshma.pattan@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1540909372-23110-1-git-send-email-reshma.pattan@intel.com> References: <1540909372-23110-1-git-send-email-reshma.pattan@intel.com> Subject: [dpdk-dev] [PATCH 3/4] net/softnic: fix string copy X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2018 14:23:00 -0000 From: Reshma Pattan Use strlcpy instead of strcpy to avoid buffer overrun. Coverity issue: 323475 Fixes: c169b6a588 ("net/softnic: map flow attribute to pipeline table") CC: cristian.dumitrescu@intel.com CC: jasvinder.singh@intel.com Signed-off-by: Reshma Pattan --- drivers/net/softnic/rte_eth_softnic_flow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/softnic/rte_eth_softnic_flow.c b/drivers/net/softnic/rte_eth_softnic_flow.c index 285af462b..295bc6c83 100644 --- a/drivers/net/softnic/rte_eth_softnic_flow.c +++ b/drivers/net/softnic/rte_eth_softnic_flow.c @@ -56,7 +56,7 @@ flow_attr_map_set(struct pmd_internals *softnic, map = (ingress) ? &softnic->flow.ingress_map[group_id] : &softnic->flow.egress_map[group_id]; - strcpy(map->pipeline_name, pipeline_name); + strlcpy(map->pipeline_name, pipeline_name, sizeof(map->pipeline_name)); map->table_id = table_id; map->valid = 1; -- 2.17.1