DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Richardson, Bruce" <bruce.richardson@intel.com>
To: Olivier MATZ <olivier.matz@6wind.com>,
	"De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] string: fix potential seg fault on snprintf
Date: Mon, 30 Jun 2014 16:48:29 +0000	[thread overview]
Message-ID: <59AF69C657FD0841A61C55336867B5B02CF1178E@IRSMSX103.ger.corp.intel.com> (raw)
In-Reply-To: <53B114C5.2050608@6wind.com>

> -----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 snprintf
> 
> 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, ...), ...
> 

Actually, I see no issue with adding tests for all those cases. The only time I would agree with not testing all inputs for validity is in a performance 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.
> 
> Regards,
> Olivier

      reply	other threads:[~2014-06-30 16:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-27 11:04 Pablo de Lara
2014-06-27 11:30 ` Olivier MATZ
2014-06-27 12:13   ` De Lara Guarch, Pablo
2014-06-27 12:34     ` Olivier MATZ
2014-06-27 16:36       ` Richardson, Bruce
2014-06-30  7:41         ` Olivier MATZ
2014-06-30 16:48           ` Richardson, Bruce [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=59AF69C657FD0841A61C55336867B5B02CF1178E@IRSMSX103.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=olivier.matz@6wind.com \
    --cc=pablo.de.lara.guarch@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).