[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1516285480-18989-1-git-send-email-serhe.popovych@gmail.com>
Date: Thu, 18 Jan 2018 16:24:40 +0200
From: Serhey Popovych <serhe.popovych@...il.com>
To: netdev@...r.kernel.org
Subject: [PATCH iproute2] iplink: Fix "alias" parameter length calculations
We need NEXT_ARG() to get *argv pointing to "alias"
parameter value. Overwise we get and check "alias"
string length.
Fixes: f88becf35e08 ("iplink: Process "alias" parameter correctly")
Signed-off-by: Serhey Popovych <serhe.popovych@...il.com>
---
ip/iplink.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ip/iplink.c b/ip/iplink.c
index 22c9a29..2db2c69 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -778,10 +778,10 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
argc--; argv++;
break;
} else if (matches(*argv, "alias") == 0) {
+ NEXT_ARG();
len = strlen(*argv);
if (len >= IFALIASZ)
invarg("alias too long\n", *argv);
- NEXT_ARG();
addattr_l(&req->n, sizeof(*req), IFLA_IFALIAS,
*argv, len);
} else if (strcmp(*argv, "group") == 0) {
--
1.7.10.4
Powered by blists - more mailing lists