From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier MATZ Subject: Re: [PATCH] string: fix potential seg fault on snprintf Date: Mon, 30 Jun 2014 09:41:57 +0200 Message-ID: <53B114C5.2050608@6wind.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> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To: "Richardson, Bruce" , "De Lara Guarch, Pablo" , "dev-VfR2kkLFssw@public.gmane.org" Return-path: In-Reply-To: <59AF69C657FD0841A61C55336867B5B02CF0DEA1-kPTMFJFq+rELt2AQoY/u9bfspsVTdybXVpNB7YpNyf8@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 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