From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.droids-corp.org (zoll.droids-corp.org [94.23.50.67]) by dpdk.org (Postfix) with ESMTP id 028EA36D for ; Mon, 30 Jun 2014 09:40:17 +0200 (CEST) Received: from was59-1-82-226-113-214.fbx.proxad.net ([82.226.113.214] helo=[192.168.0.10]) by mail.droids-corp.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1X1WEa-0005js-Qu; Mon, 30 Jun 2014 09:42:43 +0200 Message-ID: <53B114C5.2050608@6wind.com> Date: Mon, 30 Jun 2014 09:41:57 +0200 From: Olivier MATZ User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.4.0 MIME-Version: 1.0 To: "Richardson, Bruce" , "De Lara Guarch, Pablo" , "dev@dpdk.org" 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> In-Reply-To: <59AF69C657FD0841A61C55336867B5B02CF0DEA1@IRSMSX103.ger.corp.intel.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 07:40:18 -0000 Hello Bruce, 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 hurt to leave the Null-check in, and get the additional safety of checking for invalid inputs. 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, ...), ... 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. Regards, Olivier