1 diff -Nrup net-tools-1.60.orig/lib/interface.c net-tools-1.60/lib/interface.c
2 --- net-tools-1.60.orig/lib/interface.c 2004-08-12 05:54:09.000000000 -0400
3 +++ net-tools-1.60/lib/interface.c 2004-08-12 06:03:20.000000000 -0400
4 @@ -203,28 +203,34 @@ out:
6 static char *get_name(char *name, char *p)
13 - if (*p == ':') { /* could be an alias */
14 - char *dot = p, *dotname = name;
18 - if (*p != ':') { /* it wasn't, backup */
26 + /* Extract <name>[:<alias>] from nul-terminated p where p matches
27 + <name>[:<alias>]: after leading whitespace.
28 + If match is not made, set name empty and return unchanged p */
29 + int namestart=0, nameend=0, aliasend;
30 + while (isspace(p[namestart]))
33 + while (p[nameend] && p[nameend]!=':' && !isspace(p[nameend]))
35 + if (p[nameend]==':') {
37 + while (p[aliasend] && isdigit(p[aliasend]))
39 + if (p[aliasend]==':') {
42 + if ((nameend-namestart)<IFNAMSIZ) {
43 + memcpy(name,&p[namestart],nameend-namestart);
44 + name[nameend-namestart]='\0';
47 + /* Interface name too large */
52 + /* first ':' not found - return empty */