From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 795B9333 for ; Mon, 30 Jun 2014 18:48:26 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 30 Jun 2014 09:43:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,576,1400050800"; d="scan'208";a="566122398" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by orsmga002.jf.intel.com with ESMTP; 30 Jun 2014 09:48:31 -0700 Received: from irsmsx151.ger.corp.intel.com (163.33.192.59) by IRSMSX103.ger.corp.intel.com (163.33.3.157) with Microsoft SMTP Server (TLS) id 14.3.123.3; Mon, 30 Jun 2014 17:48:30 +0100 Received: from irsmsx103.ger.corp.intel.com ([169.254.3.62]) by IRSMSX151.ger.corp.intel.com ([163.33.192.59]) with mapi id 14.03.0123.003; Mon, 30 Jun 2014 17:48:29 +0100 From: "Richardson, Bruce" To: Olivier MATZ , "De Lara Guarch, Pablo" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] string: fix potential seg fault on snprintf Thread-Index: AQHPkffZSBUcLHWCN0anEVr3ItQedJuEwZOAgAAMHACAAAXigIAAU5rAgAQRq4CAAKiuAA== Date: Mon, 30 Jun 2014 16:48:29 +0000 Message-ID: <59AF69C657FD0841A61C55336867B5B02CF1178E@IRSMSX103.ger.corp.intel.com> References: <1403867097-18848-1-git-send-email-pablox.de.lara.guarch@intel.com> <53AD55BB.8090807@6wind.com> <53AD64D3.9000100@6wind.com> <59AF69C657FD0841A61C55336867B5B02CF0DEA1@IRSMSX103.ger.corp.intel.com> <53B114C5.2050608@6wind.com> In-Reply-To: <53B114C5.2050608@6wind.com> Accept-Language: en-GB, 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: Mon, 30 Jun 2014 16:48:27 -0000 > -----Original Message----- > From: Olivier MATZ [mailto:olivier.matz@6wind.com] > Sent: Monday, June 30, 2014 12:42 AM > To: Richardson, Bruce; De Lara Guarch, Pablo; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] string: fix potential seg fault on snprin= tf >=20 > Hello Bruce, >=20 > On 06/27/2014 06:36 PM, Richardson, Bruce wrote: > > Famous last words include "that could never happen!" :-) > > Since this is not a performance critical piece of code, it does not hur= t to leave > the Null-check in, and get the additional safety of checking for invalid = inputs. >=20 > The "it does not hurt" should not be an argument to keep a patch. > If we follow your reasoning, we should also add tests of > RTE_LOG(..., NULL, ...), rte_eth_dev_*(NULL, ...), ... >=20 Actually, I see no issue with adding tests for all those cases. The only ti= me I would agree with not testing all inputs for validity is in a performan= ce critical code path. > In this particular case, giving a NULL argument is meaningless because > the semantic of the function is precisely to write something in the > buffer. Moreover, as I already said, this function is not called by the > user directly. >=20 > Regards, > Olivier