mirror of
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git
synced 2024-11-30 21:34:23 +08:00
fix netlink message length checks
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
This commit is contained in:
parent
22a84711f4
commit
6cf2609ddb
@ -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 ||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user