From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH v2] metrics: fix potential missing NULL termination Date: Thu, 22 Mar 2018 10:33:08 +0000 Message-ID: <88c28dcd-3d5e-f88c-4c3a-53cb94b356e7@intel.com> References: <20180220160559.1143-1-remy.horton@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: Remy Horton , dev@dpdk.org, Bruce Richardson Return-path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 9C0C62C54 for ; Thu, 22 Mar 2018 11:33:11 +0100 (CET) In-Reply-To: <20180220160559.1143-1-remy.horton@intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 2/20/2018 4:05 PM, Remy Horton wrote: > Fixes a potential memory overrun detected by Coverity. > This overrun cannot currently happen in practice because > rte_metrics_reg_names() explicitly forces the last name > character to be a NULL terminator. This patch adds the > same enforcement to rte_metrics_get_names() in order to > correct the warning, as well as using snprintf instead > of strncpy to copy name strings. There is a patch from Bruce to convert snprintf to strlcpy [1], this patch can be part of that one. [1] https://dpdk.org/dev/patchwork/patch/35976/ > > Coverity issue: 143434 > Fixes: 349950ddb9c5 ("metrics: add information metrics library") > Fixes: 710cab6f675a ("metrics: fix out of bound access") > > Signed-off-by: Remy Horton <...>