* [PATCH iproute2] fix netlink message length checks
@ 2016-10-04 10:16 Igor Ryzhov
2016-10-10 1:59 ` Stephen Hemminger
0 siblings, 1 reply; 2+ messages in thread
From: Igor Ryzhov @ 2016-10-04 10:16 UTC (permalink / raw)
To: netdev
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
---
ip/ipaddress.c | 2 +-
lib/ll_map.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index fcc3c53..3614837 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 571d11e..4e4556c 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);
--
2.6.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH iproute2] fix netlink message length checks
2016-10-04 10:16 [PATCH iproute2] fix netlink message length checks Igor Ryzhov
@ 2016-10-10 1:59 ` Stephen Hemminger
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2016-10-10 1:59 UTC (permalink / raw)
To: Igor Ryzhov; +Cc: netdev
On Tue, 4 Oct 2016 13:16:55 +0300
Igor Ryzhov <iryzhov@nfware.com> wrote:
> Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Makes sense applied, I wonder why one of the static checkers didn't see this.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-10-10 1:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-04 10:16 [PATCH iproute2] fix netlink message length checks Igor Ryzhov
2016-10-10 1:59 ` Stephen Hemminger
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.