From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id B60931C65D for ; Wed, 4 Apr 2018 16:09:55 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 30EB7219FF; Wed, 4 Apr 2018 10:09:55 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 04 Apr 2018 10:09:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=BxrmauqywG6XbwT1SOt8SULKaM FdAEubcI9hnhCIIhA=; b=VvWnCl5Ri/znIHGPuFerKB7GjOtfbTwbcnDMzvzbec uZJWuZvZ+J7wJPvgxzJycsB4mjBdtt+LsDCamJ++wq5j5P/yALBHa+4Srj8o9xho Lx7FD3DR4csmj7KtIg9g8XT5p7izqZIjrApSs3+Wq9db01jpu8qpbPr3c6edZe5A k= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=Bxrmau qywG6XbwT1SOt8SULKaMFdAEubcI9hnhCIIhA=; b=eLVLqmf0+ZMY/gkMZSQao3 1jZDFu+AsH2dZ9fY+tW9VPwE1LXVJpHKUQbnZD4hNsDDcmeXcVefkpbePmGdvMK5 VytVr0j94apKlR5LTrr7OBCSgj60Xh0liUQmc892glpmcRjnf9z4NNC7R/+HESyN inJ4FQDodFMkBL+Nieq8FL/Y6cTpBhH8Bwj5hSwhdxP2q7Payi9JqizpvZP9iUd/ JtX9idbt9X3POSra/Pa/ARti1bYCF3x5khyg24WGgSgD6EHseVnQE48+hQwaSZNA lTWbkJV6nxPDspXclI9zQKJAUSkNIgyyeZXoQUBortY0v7R5l/sLzaHCHKtykZyA == X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 709B5E444A; Wed, 4 Apr 2018 10:09:54 -0400 (EDT) From: Thomas Monjalon To: Remy Horton Cc: dev@dpdk.org, Ferruh Yigit , Bruce Richardson Date: Wed, 04 Apr 2018 16:09:53 +0200 Message-ID: <13984140.EBaPjM1LZT@xps> In-Reply-To: <88c28dcd-3d5e-f88c-4c3a-53cb94b356e7@intel.com> References: <20180220160559.1143-1-remy.horton@intel.com> <88c28dcd-3d5e-f88c-4c3a-53cb94b356e7@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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: Wed, 04 Apr 2018 14:09:55 -0000 22/03/2018 11:33, Ferruh Yigit: > 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 Updated to use strlcpy and applied.