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