netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Stephen Hemminger' <stephen@networkplumber.org>,
	Jiri Pirko <jiri@resnulli.us>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"sthemmin@microsoft.com" <sthemmin@microsoft.com>,
	"dsahern@gmail.com" <dsahern@gmail.com>,
	"alexanderk@mellanox.com" <alexanderk@mellanox.com>,
	"mlxsw@mellanox.com" <mlxsw@mellanox.com>
Subject: RE: [patch iproute2 1/2] tc: action: fix crash caused by incorrect *argv check
Date: Wed, 24 Jul 2019 09:07:58 +0000	[thread overview]
Message-ID: <48a250ba23394bdba024cd493717cb55@AcuMS.aculab.com> (raw)
In-Reply-To: <20190723105401.4975396d@hermes.lan>

From: Stephen Hemminger
> Sent: 23 July 2019 18:54
> 
> On Tue, 23 Jul 2019 13:25:37 +0200
> Jiri Pirko <jiri@resnulli.us> wrote:
> 
> > From: Jiri Pirko <jiri@mellanox.com>
> >
> > One cannot depend on *argv being null in case of no arg is left on the
> > command line. For example in batch mode, this is not always true. Check
> > argc instead to prevent crash.

Hmmm... expecting the increments of argv and decrements of argc to match
it probably wishful thinking....
A lot of parsers don't even look at argc.

> Actually makeargs does NULL terminate the last arg so what input
> to batchmode is breaking this?

The 'usual' problem is an extra increment of argv because the last entry
was something that 'eats' two or more entries.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


  parent reply	other threads:[~2019-07-24  9:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-23 11:25 [patch iproute2 1/2] tc: action: fix crash caused by incorrect *argv check Jiri Pirko
2019-07-23 11:25 ` [patch iproute2 2/2] tc: batch: fix line/line_next processing in batch Jiri Pirko
2019-07-26 21:35   ` Stephen Hemminger
2019-07-23 17:47 ` [patch iproute2 1/2] tc: action: fix crash caused by incorrect *argv check Stephen Hemminger
2019-07-23 17:54 ` Stephen Hemminger
2019-07-23 19:36   ` Jiri Pirko
2019-07-26 19:00     ` Stephen Hemminger
2019-07-24  9:07   ` David Laight [this message]
2019-07-26 19:47 ` Stephen Hemminger
2019-07-27  8:36   ` Jiri Pirko

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=48a250ba23394bdba024cd493717cb55@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=alexanderk@mellanox.com \
    --cc=dsahern@gmail.com \
    --cc=jiri@resnulli.us \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=sthemmin@microsoft.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).