2009-03-25 12:49:42 +00:00
|
|
|
diff -up iproute2-2.6.29/iproute2-2.6.29/ip/xfrm_state.c.seg iproute2-2.6.29/iproute2-2.6.29/ip/xfrm_state.c
|
2009-04-24 07:49:30 +00:00
|
|
|
--- iproute2-2.6.29/ip/xfrm_state.c.seg 2008-07-21 17:23:12.000000000 +0200
|
|
|
|
+++ iproute2-2.6.29/ip/xfrm_state.c 2008-07-22 09:27:12.000000000 +0200
|
2008-07-22 10:23:22 +00:00
|
|
|
@@ -158,12 +158,16 @@ static int xfrm_algo_parse(struct xfrm_a
|
|
|
|
buf[j] = val;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
+ int i;
|
|
|
|
len = slen;
|
|
|
|
if (len > 0) {
|
|
|
|
if (len > max)
|
|
|
|
invarg("\"ALGOKEY\" makes buffer overflow\n", key);
|
|
|
|
|
|
|
|
- strncpy(buf, key, len);
|
|
|
|
+ for (i = 0 ; i < len && key[i] != '\0'; i++)
|
|
|
|
+ buf[i] = key[i];
|
|
|
|
+ for ( ; i < len; i++)
|
|
|
|
+ buf[i] = '\0';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|