From: Serhey Popovych Date: Thu, 18 Jan 2018 14:24:40 +0000 (+0200) Subject: iplink: Fix "alias" parameter length calculations X-Git-Tag: v4.15.0~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4fb35bdfcef9c8974392df3fb702b91cc54a755;p=thirdparty%2Fiproute2.git 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 Signed-off-by: Stephen Hemminger --- diff --git a/ip/iplink.c b/ip/iplink.c index 22c9a29ce..2db2c691c 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) {