Sophie

Sophie

distrib > Mageia > 3 > i586 > media > core-release-src > by-pkgid > 2269aee0328d979d9de644b78b94e558 > files > 32

net-tools-1.60-36.mga3.src.rpm

--- lib/interface.c	2008-12-22 12:02:43.000000000 +0100
+++ lib/interface.c.oden	2008-12-22 12:02:51.000000000 +0100
@@ -203,6 +203,7 @@ out:
 
 static char *get_name(char **namep, char *p)
 {
+    int count = 0;	
     while (isspace(*p))
 	p++;
     char *name = *namep = p;
@@ -212,8 +213,13 @@ static char *get_name(char **namep, char
 	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;
@@ -224,6 +230,9 @@ static char *get_name(char **namep, char
 	    break;
 	}
 	*name++ = *p++;
+	count++;
+	if (count == (IFNAMSIZ-1))
+    	      break;
     }
     *name++ = '\0';
     return p;