Blame SOURCES/net-tools-ifconfig-long-iface-crasher.patch

5aa31a
diff -up net-tools-2.0/lib/interface.c.long_iface net-tools-2.0/lib/interface.c
5aa31a
--- net-tools-2.0/lib/interface.c.long_iface	2012-10-04 11:35:27.983694933 +0200
5aa31a
+++ net-tools-2.0/lib/interface.c	2012-10-04 11:35:27.991694805 +0200
5aa31a
@@ -216,6 +216,7 @@ out:
5aa31a
 
5aa31a
 char *get_name(char **namep, char *p)
5aa31a
 {
5aa31a
+    int count = 0;
5aa31a
     while (isspace(*p))
5aa31a
 	p++;
5aa31a
     char *name = *namep = p;
5aa31a
@@ -224,7 +225,13 @@ char *get_name(char **namep, char *p)
5aa31a
 	    break;
5aa31a
 	if (*p == ':') {	/* could be an alias */
5aa31a
 		char *dot = p++;
5aa31a
- 		while (*p && isdigit(*p)) p++;
5aa31a
+		count++;
5aa31a
+		while (*p && isdigit(*p)) {
5aa31a
+		    p++;
5aa31a
+		    count++;
5aa31a
+		    if (count == (IFNAMSIZ-1))
5aa31a
+			break;
5aa31a
+		}
5aa31a
 		if (*p == ':') {
5aa31a
 			/* Yes it is, backup and copy it. */
5aa31a
 			p = dot;
5aa31a
@@ -240,6 +247,9 @@ char *get_name(char **namep, char *p)
5aa31a
 	    break;
5aa31a
 	}
5aa31a
 	*name++ = *p++;
5aa31a
+	count++;
5aa31a
+	if (count == (IFNAMSIZ-1))
5aa31a
+    	      break;
5aa31a
     }
5aa31a
     *name++ = '\0';
5aa31a
     return p;