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