summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorosdl.net!shemminger <osdl.net!shemminger>2005-02-07 18:17:38 +0000
committerosdl.net!shemminger <osdl.net!shemminger>2005-02-07 18:17:38 +0000
commit175e2440df5be09b0a4c134cad958a49f7bfb9d9 (patch)
tree43285d86e8698dfc9b5316d26fc4fa58a5657574 /lib
parent2ea9fa3837fbb5c6eabf634578aee50717098068 (diff)
gcc 2.95 compile fix.
(Logical change 1.138)
Diffstat (limited to 'lib')
-rw-r--r--lib/libnetlink.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libnetlink.c b/lib/libnetlink.c
index 57fa0c80..4cd2b2a1 100644
--- a/lib/libnetlink.c
+++ b/lib/libnetlink.c
@@ -553,6 +553,7 @@ int rta_addattr_l(struct rtattr *rta, int maxlen, int type,
int parse_rtattr(struct rtattr *tb[], int max, struct rtattr *rta, int len)
{
+ memset(tb, 0, sizeof(struct rtattr *) * (max + 1));
while (RTA_OK(rta, len)) {
if (rta->rta_type <= max)
tb[rta->rta_type] = rta;
@@ -566,8 +567,10 @@ int parse_rtattr(struct rtattr *tb[], int max, struct rtattr *rta, int len)
int parse_rtattr_byindex(struct rtattr *tb[], int max, struct rtattr *rta, int len)
{
int i = 0;
+
+ memset(tb, 0, sizeof(struct rtattr *) * max);
while (RTA_OK(rta, len)) {
- if (rta->rta_type <= max)
+ if (rta->rta_type <= max && i < max)
tb[i++] = rta;
rta = RTA_NEXT(rta,len);
}