From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 068592C27 for ; Sat, 6 May 2017 11:03:48 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 606D120AEB; Sat, 6 May 2017 05:03:48 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Sat, 06 May 2017 05:03:48 -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:x-sasl-enc; s=mesmtp; bh=bIop8mNfhkyyfpg xR4zlK9MCf2QqrfYG78y7ZLJlz5Y=; b=hdwd1O3kw7uybv27qRqYSZKZYxQRK0N SY7i2gajYUz5Z7HuViAqgL7WAXUQg6FZfL7fYWH1KEOHC/HYRKnG0runu0qqCUKH tMJ36zoEyp3x0ZfNL1dpOu7b0HuE1IT67+9qz9Rmnlv4tnIvR+JR0BrF4z8K8lqm JcV9BgNzxHPY= 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:x-sasl-enc; s= fm1; bh=bIop8mNfhkyyfpgxR4zlK9MCf2QqrfYG78y7ZLJlz5Y=; b=DlMl8auK IgXJRwGGHnjtQoytXfwFrkiabwcydD5+Na09q4k/DZ9stT3T0lPOMpFmbMGSYQFB MCFKYkHm9CNbYQBa7ax3PzyUEbi7xVQPlXGNTuU31Jzs0lzNj3FzVoPu+AXFyMFn S9xtmGiiIUuUTix4xHH13G99p774+Nro/N8KqHXyL3vWnNltu4kBJ9NvKUF3DELM dQec1IFJ3AcNf78bB9v8HbZkVQpsaYRD3IrAuEy8UpFtX8iIy44mMryIwkkItEQb Xuxhqztydv1AAxacEbHGoJoCZ1iiylkOGivfbZERTIAJpBYu/XTyf928chGrgSPr UaZ9BK38errs6Q== X-ME-Sender: X-Sasl-enc: PylQ7gjJAi3bqBvVrMy+W3vPKOq9CxTHWafDe0u0xeV7 1494061428 Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 1DF887E21D; Sat, 6 May 2017 05:03:48 -0400 (EDT) From: Thomas Monjalon To: Roman Korynkevych , maryam.tahhan@intel.com, reshma.pattan@intel.com Cc: dev@dpdk.org, harry.van.haaren@intel.com Date: Sat, 06 May 2017 11:03:47 +0200 Message-ID: <2111266.yHnu9HNQaI@xps> In-Reply-To: <1492787196-9101-1-git-send-email-romanx.korynkevych@intel.com> References: <1492787196-9101-1-git-send-email-romanx.korynkevych@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v1 1/1] app/procinfo: buffer null termination fix. 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: Sat, 06 May 2017 09:03:49 -0000 21/04/2017 17:06, Roman Korynkevych: > Coverity issue: 143252 > Fixes: 2deb6b5246d7706448d070335b329d1acb754cee ("app/procinfo: add collectd format and host id") > Cc: stable@dpdk.org > > Signed-off-by: Roman Korynkevych > --- > app/proc_info/main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/app/proc_info/main.c b/app/proc_info/main.c > index 16b27b2..97d0352 100644 > --- a/app/proc_info/main.c > +++ b/app/proc_info/main.c > @@ -189,7 +189,7 @@ proc_info_preparse_args(int argc, char **argv) > proc_info_usage(prgname); > return -1; > } > - strncpy(host_id, argv[i+1], sizeof(host_id)); > + strncpy(host_id, argv[i+1], sizeof(host_id)-1); The full array size should be given to strncpy. However, the call to gethostname below seems wrong as it does not use the full size. Maryam, Reshma, Please review the procinfo patches.