netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Webster <dsw@hexology.net>
To: netdev@vger.kernel.org
Cc: Dan Webster <dsw@hexology.net>,
	Stephen Hemminger <shemming@brocade.com>,
	Vadim Kochan <vadim4j@gmail.com>
Subject: [PATCH iproute2] ss: fix file-based filtering segfault
Date: Thu, 24 Sep 2015 09:36:53 +0200	[thread overview]
Message-ID: <1443080213-2553-1-git-send-email-dsw@hexology.net> (raw)

Commit 1527a17 introduced a change where the second of two ssfilter_parse()
calls in ss.c was moved outside of a conditional block (ss.c: ~3575). This
commit enabled the parsing of services, such as 'sport = :ssh', but
inadvertently broke the '-F' file-based filtering:

--
$ cat filt.txt
src 127.0.0.1

$ ss -F filt.txt
Segmentation fault (core dumped)

Program received signal SIGSEGV, Segmentation fault.
yylex () at ssfilter.y:183
183         while (*tokptr == 0) {
--

The first (redundant) ssfilter_parse() was mangling yylex() for the latter
call.

Signed-off-by: Dan Webster <dsw@hexology.net>
---
 misc/ss.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/misc/ss.c b/misc/ss.c
index 9efc3c8..7c3dfa3 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -3782,12 +3782,6 @@ int main(int argc, char *argv[])
 			exit(0);
 	}
 
-	/* Now parse filter... */
-	if (argc == 0 && filter_fp) {
-		if (ssfilter_parse(&current_filter.f, 0, NULL, filter_fp))
-			usage();
-	}
-
 	while (argc > 0) {
 		if (strcmp(*argv, "state") == 0) {
 			NEXT_ARG();
-- 
2.1.4

                 reply	other threads:[~2015-09-24  7:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1443080213-2553-1-git-send-email-dsw@hexology.net \
    --to=dsw@hexology.net \
    --cc=netdev@vger.kernel.org \
    --cc=shemming@brocade.com \
    --cc=vadim4j@gmail.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).