626e1f7
diff -up net-tools-1.60/lib/interface.c.long_iface net-tools-1.60/lib/interface.c
626e1f7
--- net-tools-1.60/lib/interface.c.long_iface	2011-12-05 18:16:38.000000000 +0100
626e1f7
+++ net-tools-1.60/lib/interface.c	2011-12-05 19:13:17.343530194 +0100
626e1f7
@@ -216,6 +216,7 @@ out:
8124c94
 
626e1f7
 char *get_name(char **namep, char *p)
8124c94
 {
626e1f7
+    int count = 0;
8124c94
     while (isspace(*p))
8124c94
 	p++;
Zdenek Prikryl 9634070
     char *name = *namep = p;
626e1f7
@@ -224,7 +225,13 @@ char *get_name(char **namep, char *p)
626e1f7
 	    break;
8124c94
 	if (*p == ':') {	/* could be an alias */
626e1f7
 		char *dot = p++;
626e1f7
- 		while (*p && isdigit(*p)) p++;
626e1f7
+		count++;
626e1f7
+		while (*p && isdigit(*p)) {
626e1f7
+		    p++;
626e1f7
+		    count++;
626e1f7
+		    if (count == (IFNAMSIZ-1))
626e1f7
+			break;
626e1f7
+		}
626e1f7
 		if (*p == ':') {
626e1f7
 			/* Yes it is, backup and copy it. */
626e1f7
 			p = dot;
626e1f7
@@ -240,6 +247,9 @@ char *get_name(char **namep, char *p)
8124c94
 	    break;
8124c94
 	}
8124c94
 	*name++ = *p++;
8124c94
+	count++;
8124c94
+	if (count == (IFNAMSIZ-1))
8124c94
+    	      break;
8124c94
     }
8124c94
     *name++ = '\0';
8124c94
     return p;