From mboxrd@z Thu Jan 1 00:00:00 1970 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) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Mar 2018 03:33:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,344,1517904000"; d="scan'208";a="41207830" Received: from fyigit-mobl.ger.corp.intel.com (HELO [10.237.221.63]) ([10.237.221.63]) by orsmga001.jf.intel.com with ESMTP; 22 Mar 2018 03:33:09 -0700 To: Remy Horton , dev@dpdk.org, Bruce Richardson References: <20180220160559.1143-1-remy.horton@intel.com> From: Ferruh Yigit Message-ID: <88c28dcd-3d5e-f88c-4c3a-53cb94b356e7@intel.com> Date: Thu, 22 Mar 2018 10:33:08 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180220160559.1143-1-remy.horton@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2] metrics: fix potential missing NULL termination 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: Thu, 22 Mar 2018 10:33:12 -0000 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 <...>