From: Stephen Hemminger Date: Fri, 20 Dec 2013 16:25:13 +0000 (-0800) Subject: veth: fix uninitialized arguments X-Git-Tag: v3.14.0~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be2c3142f9a76ae1f036fc4316ff425f6455ce3a;p=thirdparty%2Fiproute2.git veth: fix uninitialized arguments Based on patch by Sergey Popovich This fixes crash when ip-link(8) invoced with command: ip link add dev veth1a type veth peer --- diff --git a/ip/link_veth.c b/ip/link_veth.c index 7730f3941..f357182f0 100644 --- a/ip/link_veth.c +++ b/ip/link_veth.c @@ -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;