]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/blob - net-tools/patches/net-tools-1.60-ifconfig-long-iface-crasher.patch
Move all packages to root.
[people/amarx/ipfire-3.x.git] / net-tools / patches / net-tools-1.60-ifconfig-long-iface-crasher.patch
1 diff -Naurp net-tools-1.60-ifconfig-new/lib/interface.c net-tools-1.60-ifconfig/lib/interface.c
2 --- net-tools-1.60-ifconfig-new/lib/interface.c 2006-03-23 07:02:48.000000000 +0100
3 +++ net-tools-1.60-ifconfig/lib/interface.c 2006-03-23 09:58:45.000000000 +0100
4 @@ -203,6 +203,7 @@ out:
5
6 static char *get_name(char **namep, char *p)
7 {
8 + int count = 0;
9 while (isspace(*p))
10 p++;
11 char *name = *namep = p;
12 @@ -211,8 +212,13 @@ static char *get_name(char **namep, char
13 if (*p == ':') { /* could be an alias */
14 char *dot = p, *dotname = name;
15 *name++ = *p++;
16 - while (isdigit(*p))
17 + count++;
18 + while (isdigit(*p)){
19 *name++ = *p++;
20 + count++;
21 + if (count == (IFNAMSIZ-1))
22 + break;
23 + }
24 if (*p != ':') { /* it wasn't, backup */
25 p = dot;
26 name = dotname;
27 @@ -223,6 +229,9 @@ static char *get_name(char **namep, char
28 break;
29 }
30 *name++ = *p++;
31 + count++;
32 + if (count == (IFNAMSIZ-1))
33 + break;
34 }
35 *name++ = '\0';
36 return p;