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:
Stephen Hemminger 2007-12-10 11:34:40 -08:00
parent 5472ac6f9f
commit 037c635eee
1 changed files with 1 additions and 1 deletions

View File

@ -632,6 +632,6 @@ int __parse_rtattr_nested_compat(struct rtattr *tb[], int max, struct rtattr *rt
rta = RTA_DATA(rta) + RTA_ALIGN(len);
return parse_rtattr_nested(tb, max, rta);
}
memset(tb, 0, sizeof(struct rtattr *) * max);
memset(tb, 0, sizeof(struct rtattr *) * (max + 1));
return 0;
}