]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
veth: fix uninitialized arguments
authorStephen Hemminger <stephen@networkplumber.org>
Fri, 20 Dec 2013 16:25:13 +0000 (08:25 -0800)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 20 Dec 2013 16:25:13 +0000 (08:25 -0800)
Based on patch by Sergey Popovich <popovich_sergei@mail.ru>
This fixes crash when ip-link(8) invoced with command:

  ip link add dev veth1a type veth peer

ip/link_veth.c

index 7730f3941b489386ff2f28af981feef479c7e56e..f357182f0031431c0a0c99cbb82b80f1da83be45 100644 (file)
@@ -26,7 +26,10 @@ static void usage(void)
 static int veth_parse_opt(struct link_util *lu, int argc, char **argv,
                          struct nlmsghdr *hdr)
 {
-       char *name, *type, *link, *dev;
+       char *dev = NULL;
+       char *name = NULL;
+       char *link = NULL;
+       char *type = NULL;
        int err, len;
        struct rtattr * data;
        int group;