From: Roy Marples Date: Wed, 10 Sep 2014 16:36:24 +0000 (+0000) Subject: Fix parsing the netlink message when no options are present. X-Git-Tag: v6.4.4~25 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5dfbf54058d4fa649c11a7483b7bcad96a183513;p=thirdparty%2Fdhcpcd.git Fix parsing the netlink message when no options are present. --- diff --git a/if-linux.c b/if-linux.c index f326ed11..762ab5f7 100644 --- a/if-linux.c +++ b/if-linux.c @@ -891,6 +891,7 @@ gnl_parse(struct nlmsghdr *nlm, struct nlattr *tb[], int maxtype) size_t len, rem; int type; + memset(tb, 0, sizeof(*tb) * (maxtype + 1)); ghdr = NLMSG_DATA(nlm); head = (struct nlattr *)((char *) ghdr + GENL_HDRLEN); len = nlm->nlmsg_len - GENL_HDRLEN - NLMSG_HDRLEN;