All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH iproute2] iplink: Fix "alias" parameter length calculations
@ 2018-01-18 14:24 Serhey Popovych
  2018-01-19  0:28 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Serhey Popovych @ 2018-01-18 14:24 UTC (permalink / raw)
  To: netdev

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@gmail.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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH iproute2] iplink: Fix "alias" parameter length calculations
  2018-01-18 14:24 [PATCH iproute2] iplink: Fix "alias" parameter length calculations Serhey Popovych
@ 2018-01-19  0:28 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2018-01-19  0:28 UTC (permalink / raw)
  To: Serhey Popovych; +Cc: netdev

On Thu, 18 Jan 2018 16:24:40 +0200
Serhey Popovych <serhe.popovych@gmail.com> wrote:

> 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@gmail.com>

Good catch. Applied thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-19  0:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-18 14:24 [PATCH iproute2] iplink: Fix "alias" parameter length calculations Serhey Popovych
2018-01-19  0:28 ` Stephen Hemminger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.