Fix off by one in nested attribute management.
Fixes segv in: tc qdisc show dev eth1 due to uninitialized attribute table. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
This commit is contained in:
parent
5472ac6f9f
commit
037c635eee
|
|
@ -632,6 +632,6 @@ int __parse_rtattr_nested_compat(struct rtattr *tb[], int max, struct rtattr *rt
|
||||||
rta = RTA_DATA(rta) + RTA_ALIGN(len);
|
rta = RTA_DATA(rta) + RTA_ALIGN(len);
|
||||||
return parse_rtattr_nested(tb, max, rta);
|
return parse_rtattr_nested(tb, max, rta);
|
||||||
}
|
}
|
||||||
memset(tb, 0, sizeof(struct rtattr *) * max);
|
memset(tb, 0, sizeof(struct rtattr *) * (max + 1));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue