DPDK patches and discussions
 help / color / mirror / Atom feed
From: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>
To: Olivier MATZ <olivier.matz@6wind.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] string: fix potential seg fault on snprintf
Date: Fri, 27 Jun 2014 12:13:24 +0000	[thread overview]
Message-ID: <E115CCD9D858EF4F90C690B0DCB4D8971A790399@IRSMSX103.ger.corp.intel.com> (raw)
In-Reply-To: <53AD55BB.8090807@6wind.com>

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 snprintf
> 
> Hello Pablo,
> 
> On 06/27/2014 01:04 PM, Pablo de Lara wrote:
> > From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> >
> > Several functions did not check if destination buffer, used
> > in snprintf was a non-NULL pointer.
> 
> Did you noticed any issue without this patch?

With last Thomas' patch, cmdline unit test does not pass due to this problem (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.
> 
> I would say the same for pci_get_uio_dev().
> 

So, if people prefer to discard this patch, then we should modify the cmdline unit test , 
or we could just include the test only in the places needed for the unit test 
(so, remove it in pci_get_uio_dev, for instance).

Regards,
Pablo

  reply	other threads:[~2014-06-27 12:13 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 [this message]
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

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=E115CCD9D858EF4F90C690B0DCB4D8971A790399@IRSMSX103.ger.corp.intel.com \
    --to=pablo.de.lara.guarch@intel.com \
    --cc=dev@dpdk.org \
    --cc=olivier.matz@6wind.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).