Commit 7849fb55 authored by shemminger's avatar shemminger

Fix memcpy overwrite in iproute.c because of bits vs. bytes confusion

parent 8c564a48
2005-10-12 Stephen Hemminger <shemminger@osdl.org>
* Add more CBQ examples from Fedora Core
* Fix buffer overrun in iproute because of bits vs. bytes confusion
2005-10-12 Jamal Hadi Salim <hadi@znyx.com>
......
......@@ -216,13 +216,13 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
memset(&via, 0, sizeof(via));
via.family = r->rtm_family;
if (tb[RTA_GATEWAY])
memcpy(&via.data, RTA_DATA(tb[RTA_GATEWAY]), host_len);
memcpy(&via.data, RTA_DATA(tb[RTA_GATEWAY]), host_len/8);
}
if (filter.rprefsrc.bitlen>0) {
memset(&prefsrc, 0, sizeof(prefsrc));
prefsrc.family = r->rtm_family;
if (tb[RTA_PREFSRC])
memcpy(&prefsrc.data, RTA_DATA(tb[RTA_PREFSRC]), host_len);
memcpy(&prefsrc.data, RTA_DATA(tb[RTA_PREFSRC]), host_len/8);
}
if (filter.rdst.family && inet_addr_match(&dst, &filter.rdst, filter.rdst.bitlen))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment