From: Igor Ryzhov Date: Tue, 4 Oct 2016 10:16:55 +0000 (+0300) Subject: fix netlink message length checks X-Git-Tag: v4.8.0~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6cf2609ddb724164cbfa746e388b7942d09a9d64;p=thirdparty%2Fiproute2.git fix netlink message length checks Signed-off-by: Igor Ryzhov --- diff --git a/ip/ipaddress.c b/ip/ipaddress.c index fcc3c538d..361483762 100644 --- a/ip/ipaddress.c +++ b/ip/ipaddress.c @@ -1218,7 +1218,7 @@ static int print_selected_addrinfo(struct ifinfomsg *ifi, if (n->nlmsg_type != RTM_NEWADDR) continue; - if (n->nlmsg_len < NLMSG_LENGTH(sizeof(ifa))) + if (n->nlmsg_len < NLMSG_LENGTH(sizeof(*ifa))) return -1; if (ifa->ifa_index != ifi->ifi_index || diff --git a/lib/ll_map.c b/lib/ll_map.c index 571d11e1c..4e4556c9a 100644 --- a/lib/ll_map.c +++ b/lib/ll_map.c @@ -90,7 +90,7 @@ int ll_remember_index(const struct sockaddr_nl *who, if (n->nlmsg_type != RTM_NEWLINK && n->nlmsg_type != RTM_DELLINK) return 0; - if (n->nlmsg_len < NLMSG_LENGTH(sizeof(ifi))) + if (n->nlmsg_len < NLMSG_LENGTH(sizeof(*ifi))) return -1; im = ll_get_by_index(ifi->ifi_index);