2012-10-04 09:54:40 +00:00
|
|
|
diff -up net-tools-2.0/lib/interface.c.long_iface net-tools-2.0/lib/interface.c
|
2014-11-24 14:15:01 +00:00
|
|
|
--- net-tools-2.0/lib/interface.c.long_iface 2014-11-24 15:09:45.130254503 +0100
|
|
|
|
+++ net-tools-2.0/lib/interface.c 2014-11-24 15:10:54.662270496 +0100
|
2011-12-06 18:15:09 +00:00
|
|
|
@@ -216,6 +216,7 @@ out:
|
2006-05-09 09:27:14 +00:00
|
|
|
|
2014-11-24 14:15:01 +00:00
|
|
|
static const char *get_name(char **namep, const char *p)
|
2006-05-09 09:27:14 +00:00
|
|
|
{
|
2011-12-06 18:15:09 +00:00
|
|
|
+ int count = 0;
|
2006-05-09 09:27:14 +00:00
|
|
|
while (isspace(*p))
|
|
|
|
p++;
|
2008-07-15 12:30:02 +00:00
|
|
|
char *name = *namep = p;
|
2014-11-24 14:15:01 +00:00
|
|
|
@@ -224,7 +225,13 @@ static const char *get_name(char **namep
|
2011-12-06 18:15:09 +00:00
|
|
|
break;
|
2006-05-09 09:27:14 +00:00
|
|
|
if (*p == ':') { /* could be an alias */
|
2014-11-24 14:15:01 +00:00
|
|
|
const char *dot = p++;
|
2011-12-06 18:15:09 +00:00
|
|
|
- while (*p && isdigit(*p)) p++;
|
|
|
|
+ count++;
|
|
|
|
+ while (*p && isdigit(*p)) {
|
|
|
|
+ p++;
|
|
|
|
+ count++;
|
|
|
|
+ if (count == (IFNAMSIZ-1))
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
if (*p == ':') {
|
|
|
|
/* Yes it is, backup and copy it. */
|
|
|
|
p = dot;
|
2014-11-24 14:15:01 +00:00
|
|
|
@@ -240,6 +247,9 @@ static const char *get_name(char **namep
|
2006-05-09 09:27:14 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
*name++ = *p++;
|
|
|
|
+ count++;
|
|
|
|
+ if (count == (IFNAMSIZ-1))
|
|
|
|
+ break;
|
|
|
|
}
|
|
|
|
*name++ = '\0';
|
|
|
|
return p;
|