From mboxrd@z Thu Jan 1 00:00:00 1970 From: Serhey Popovych Subject: [PATCH iproute2] iplink: Fix "alias" parameter length calculations Date: Thu, 18 Jan 2018 16:24:40 +0200 Message-ID: <1516285480-18989-1-git-send-email-serhe.popovych@gmail.com> To: netdev@vger.kernel.org Return-path: Received: from mail-lf0-f68.google.com ([209.85.215.68]:37016 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756487AbeAROZK (ORCPT ); Thu, 18 Jan 2018 09:25:10 -0500 Received: by mail-lf0-f68.google.com with SMTP id f3so26908589lfe.4 for ; Thu, 18 Jan 2018 06:25:09 -0800 (PST) Received: from tuxracer.localdomain ([2a01:6d80::195:20:96:53]) by smtp.gmail.com with ESMTPSA id d80sm1326026ljd.51.2018.01.18.06.25.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 06:25:07 -0800 (PST) Sender: netdev-owner@vger.kernel.org List-ID: 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 --- 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