|
|
36cfb7 |
From ce3460e0a39948054139e5bcf72130e82bf2da8d Mon Sep 17 00:00:00 2001
|
|
|
36cfb7 |
From: Andrea Claudi <aclaudi@redhat.com>
|
|
|
36cfb7 |
Date: Mon, 29 Apr 2019 20:08:07 +0200
|
|
|
36cfb7 |
Subject: [PATCH] iproute: Check mark value input
|
|
|
36cfb7 |
|
|
|
36cfb7 |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1465646
|
|
|
36cfb7 |
Upstream Status: iproute2.git commit 7c66d89828a6e
|
|
|
36cfb7 |
|
|
|
36cfb7 |
commit 7c66d89828a6ee4c5a4e3f48ef4a4cb07b50013d
|
|
|
36cfb7 |
Author: Phil Sutter <phil@nwl.cc>
|
|
|
36cfb7 |
Date: Mon Aug 21 18:36:50 2017 +0200
|
|
|
36cfb7 |
|
|
|
36cfb7 |
iproute: Check mark value input
|
|
|
36cfb7 |
|
|
|
36cfb7 |
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
|
36cfb7 |
---
|
|
|
36cfb7 |
ip/iproute.c | 6 ++++--
|
|
|
36cfb7 |
1 file changed, 4 insertions(+), 2 deletions(-)
|
|
|
36cfb7 |
|
|
|
36cfb7 |
diff --git a/ip/iproute.c b/ip/iproute.c
|
|
|
36cfb7 |
index 6ebc6214c45ee..1d92530fd3421 100644
|
|
|
36cfb7 |
--- a/ip/iproute.c
|
|
|
36cfb7 |
+++ b/ip/iproute.c
|
|
|
36cfb7 |
@@ -1481,7 +1481,8 @@ static int iproute_list_flush_or_save(int argc, char **argv, int action)
|
|
|
36cfb7 |
id = *argv;
|
|
|
36cfb7 |
} else if (strcmp(*argv, "mark") == 0) {
|
|
|
36cfb7 |
NEXT_ARG();
|
|
|
36cfb7 |
- get_unsigned(&mark, *argv, 0);
|
|
|
36cfb7 |
+ if (get_unsigned(&mark, *argv, 0))
|
|
|
36cfb7 |
+ invarg("invalid mark value", *argv);
|
|
|
36cfb7 |
filter.markmask = -1;
|
|
|
36cfb7 |
} else if (strcmp(*argv, "via") == 0) {
|
|
|
36cfb7 |
int family;
|
|
|
36cfb7 |
@@ -1698,7 +1699,8 @@ static int iproute_get(int argc, char **argv)
|
|
|
36cfb7 |
idev = *argv;
|
|
|
36cfb7 |
} else if (matches(*argv, "mark") == 0) {
|
|
|
36cfb7 |
NEXT_ARG();
|
|
|
36cfb7 |
- get_unsigned(&mark, *argv, 0);
|
|
|
36cfb7 |
+ if (get_unsigned(&mark, *argv, 0))
|
|
|
36cfb7 |
+ invarg("invalid mark value", *argv);
|
|
|
36cfb7 |
} else if (matches(*argv, "oif") == 0 ||
|
|
|
36cfb7 |
strcmp(*argv, "dev") == 0) {
|
|
|
36cfb7 |
NEXT_ARG();
|
|
|
36cfb7 |
--
|
|
|
e138d9 |
2.21.0
|
|
|
36cfb7 |
|