Fix memcpy overwrite in iproute.c because of bits vs. bytes confusion
This commit is contained in:
parent
8c564a4873
commit
7849fb5591
|
|
@ -1,7 +1,8 @@
|
||||||
2005-10-12 Stephen Hemminger <shemminger@osdl.org>
|
2005-10-12 Stephen Hemminger <shemminger@osdl.org>
|
||||||
|
|
||||||
* Add more CBQ examples from Fedora Core
|
* 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>
|
2005-10-12 Jamal Hadi Salim <hadi@znyx.com>
|
||||||
|
|
||||||
* Fix ip rule flush, need to reopen rtnl
|
* Fix ip rule flush, need to reopen rtnl
|
||||||
|
|
|
||||||
|
|
@ -216,13 +216,13 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
|
||||||
memset(&via, 0, sizeof(via));
|
memset(&via, 0, sizeof(via));
|
||||||
via.family = r->rtm_family;
|
via.family = r->rtm_family;
|
||||||
if (tb[RTA_GATEWAY])
|
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) {
|
if (filter.rprefsrc.bitlen>0) {
|
||||||
memset(&prefsrc, 0, sizeof(prefsrc));
|
memset(&prefsrc, 0, sizeof(prefsrc));
|
||||||
prefsrc.family = r->rtm_family;
|
prefsrc.family = r->rtm_family;
|
||||||
if (tb[RTA_PREFSRC])
|
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))
|
if (filter.rdst.family && inet_addr_match(&dst, &filter.rdst, filter.rdst.bitlen))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue