From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id BDF6B5947 for ; Fri, 27 Jun 2014 14:13:16 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 27 Jun 2014 05:13:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,560,1400050800"; d="scan'208";a="561829891" Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by fmsmga002.fm.intel.com with ESMTP; 27 Jun 2014 05:13:25 -0700 Received: from irsmsx154.ger.corp.intel.com (163.33.192.96) by IRSMSX101.ger.corp.intel.com (163.33.3.153) with Microsoft SMTP Server (TLS) id 14.3.123.3; Fri, 27 Jun 2014 13:13:25 +0100 Received: from irsmsx103.ger.corp.intel.com ([169.254.3.62]) by IRSMSX154.ger.corp.intel.com ([169.254.12.216]) with mapi id 14.03.0123.003; Fri, 27 Jun 2014 13:13:25 +0100 From: "De Lara Guarch, Pablo" To: Olivier MATZ , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] string: fix potential seg fault on snprintf Thread-Index: AQHPkferSEdgwsm4WUSckudAxG2XIpuEwZOAgAAaWlA= Date: Fri, 27 Jun 2014 12:13:24 +0000 Message-ID: References: <1403867097-18848-1-git-send-email-pablox.de.lara.guarch@intel.com> <53AD55BB.8090807@6wind.com> In-Reply-To: <53AD55BB.8090807@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] string: fix potential seg fault on snprintf X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jun 2014 12:13:17 -0000 Hi Olivier > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Olivier MATZ > Sent: Friday, June 27, 2014 12:30 PM > To: De Lara Guarch, Pablo; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] string: fix potential seg fault on snprin= tf >=20 > Hello Pablo, >=20 > On 06/27/2014 01:04 PM, Pablo de Lara wrote: > > From: Pablo de Lara > > > > Several functions did not check if destination buffer, used > > in snprintf was a non-NULL pointer. >=20 > Did you noticed any issue without this patch? With last Thomas' patch, cmdline unit test does not pass due to this proble= m (basically it tests this situation). After test passed, by fixing this issue in several functions, I looked for = other places where this happened. > It seems that all the get_help() cmdline functions are never called > with a NULL destination buffer (see in cmdline_parse.c). I think it > is useless to add this test as there is no good reason to give a NULL > argument. It is like testing that the arguments of strcpy() are > non-NULL. >=20 > I would say the same for pci_get_uio_dev(). >=20 So, if people prefer to discard this patch, then we should modify the cmdli= ne unit test ,=20 or we could just include the test only in the places needed for the unit te= st=20 (so, remove it in pci_get_uio_dev, for instance). Regards, Pablo