2006-05-09 09:27:14 +00:00
|
|
|
diff -Naurp net-tools-1.60-ifconfig-new/lib/interface.c net-tools-1.60-ifconfig/lib/interface.c
|
|
|
|
--- net-tools-1.60-ifconfig-new/lib/interface.c 2006-03-23 07:02:48.000000000 +0100
|
|
|
|
+++ net-tools-1.60-ifconfig/lib/interface.c 2006-03-23 09:58:45.000000000 +0100
|
|
|
|
@@ -203,6 +203,7 @@ out:
|
|
|
|
|
2008-07-15 12:30:02 +00:00
|
|
|
static char *get_name(char **namep, char *p)
|
2006-05-09 09:27:14 +00:00
|
|
|
{
|
|
|
|
+ int count = 0;
|
|
|
|
while (isspace(*p))
|
|
|
|
p++;
|
2008-07-15 12:30:02 +00:00
|
|
|
char *name = *namep = p;
|
|
|
|
@@ -211,8 +212,13 @@ static char *get_name(char **namep, char
|
2006-05-09 09:27:14 +00:00
|
|
|
if (*p == ':') { /* could be an alias */
|
|
|
|
char *dot = p, *dotname = name;
|
|
|
|
*name++ = *p++;
|
|
|
|
- while (isdigit(*p))
|
|
|
|
+ count++;
|
|
|
|
+ while (isdigit(*p)){
|
|
|
|
*name++ = *p++;
|
|
|
|
+ count++;
|
|
|
|
+ if (count == (IFNAMSIZ-1))
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
if (*p != ':') { /* it wasn't, backup */
|
|
|
|
p = dot;
|
|
|
|
name = dotname;
|
2008-07-15 12:30:02 +00:00
|
|
|
@@ -223,6 +229,9 @@ static char *get_name(char **namep, char
|
2006-05-09 09:27:14 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
*name++ = *p++;
|
|
|
|
+ count++;
|
|
|
|
+ if (count == (IFNAMSIZ-1))
|
|
|
|
+ break;
|
|
|
|
}
|
|
|
|
*name++ = '\0';
|
|
|
|
return p;
|