From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH v6 14/16] app/proc-info: sprintf overrun bug Date: Mon, 14 May 2018 21:31:49 +0100 Message-ID: References: <152627394448.52758.15834703911138407294.stgit@localhost.localdomain> <152627406233.52758.14586673394606574914.stgit@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit To: Andy Green , dev@dpdk.org Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 6A7906D85 for ; Mon, 14 May 2018 22:31:51 +0200 (CEST) In-Reply-To: <152627406233.52758.14586673394606574914.stgit@localhost.localdomain> 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 5/14/2018 6:01 AM, Andy Green wrote: > /home/agreen/projects/dpdk/app/proc-info/main.c: In function > ‘nic_xstats_display’: > /home/agreen/projects/dpdk/app/proc-info/main.c:495:45: > error: ‘%s’ directive writing up to 255 bytes into a region > of size between 165 and 232 [-Werror=format-overflow=] > sprintf(buf, "PUTVAL %s/dpdkstat-port.%u/%s-%s N:%" > ^~ > PRIu64"\n", host_id, port_id, counter_type, > ~~~~~~~~~~~~ > /home/agreen/projects/dpdk/app/proc-info/main.c:495:4: note: > ‘sprintf’ output between 31 and 435 bytes into a destination > of size 256 > sprintf(buf, "PUTVAL %s/dpdkstat-port.%u/%s-%s N:%" > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > PRIu64"\n", host_id, port_id, counter_type, > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > xstats_names[i].name, values[i]); > > Signed-off-by: Andy Green > Fixes: 2deb6b5246d7 ("app/procinfo: add collectd format and host id") > Cc: stable@dpdk.org Reviewed-by: Ferruh Yigit