[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170812120510.28750-12-phil@nwl.cc>
Date: Sat, 12 Aug 2017 14:04:30 +0200
From: Phil Sutter <phil@....cc>
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: netdev@...r.kernel.org
Subject: [iproute PATCH 11/51] iproute: Check mark value input
Signed-off-by: Phil Sutter <phil@....cc>
---
ip/iproute.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/ip/iproute.c b/ip/iproute.c
index 89caac124f489..5fe8a3a75d5b7 100644
--- a/ip/iproute.c
+++ b/ip/iproute.c
@@ -1495,7 +1495,8 @@ static int iproute_list_flush_or_save(int argc, char **argv, int action)
id = *argv;
} else if (strcmp(*argv, "mark") == 0) {
NEXT_ARG();
- get_unsigned(&mark, *argv, 0);
+ if (get_unsigned(&mark, *argv, 0))
+ invarg("invalid mark value\n", *argv);
filter.markmask = -1;
} else if (strcmp(*argv, "via") == 0) {
int family;
@@ -1712,7 +1713,8 @@ static int iproute_get(int argc, char **argv)
idev = *argv;
} else if (matches(*argv, "mark") == 0) {
NEXT_ARG();
- get_unsigned(&mark, *argv, 0);
+ if (get_unsigned(&mark, *argv, 0))
+ invarg("invalid mark value\n", *argv);
} else if (matches(*argv, "oif") == 0 ||
strcmp(*argv, "dev") == 0) {
NEXT_ARG();
--
2.13.1
Powered by blists - more mailing lists