From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v1 1/1] app/procinfo: buffer null termination fix. Date: Sat, 06 May 2017 11:03:47 +0200 Message-ID: <2111266.yHnu9HNQaI@xps> References: <1492787196-9101-1-git-send-email-romanx.korynkevych@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, harry.van.haaren@intel.com To: Roman Korynkevych , maryam.tahhan@intel.com, reshma.pattan@intel.com 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) In-Reply-To: <1492787196-9101-1-git-send-email-romanx.korynkevych@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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.