aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshwini sharma <ak.ashwini1981@gmail.com>2014-04-13 16:04:16 -0500
committerAshwini sharma <ak.ashwini1981@gmail.com>2014-04-13 16:04:16 -0500
commit1d12fb66550660f97ef90484dc31304eddfd4bf7 (patch)
tree144523af77516b67da3acbe8dbc97dd58e85a4de
parent0d8467b371d93bff03f59a8f11f01094f7618372 (diff)
downloadtoybox-1d12fb66550660f97ef90484dc31304eddfd4bf7.tar.gz
An issue in ifconfig while verifying the HW Address, which is assumed to be of the format __C2:79:38:95:CD:AB__ but can be of form __C2:79:38:95:D:A__. In this case the HW address is reported as bad.
-rw-r--r--toys/other/ifconfig.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/other/ifconfig.c b/toys/other/ifconfig.c
index 6dcda835..a84e26ac 100644
--- a/toys/other/ifconfig.c
+++ b/toys/other/ifconfig.c
@@ -415,7 +415,7 @@ void ifconfig_main(void)
if (*hw_addr == ':') hw_addr++;
sscanf(hw_addr, "%2x%n", &val, &len);
- if (len != 2) break;
+ if (!len || len > 2) break; // 1 nibble can be set e.g. C2:79:38:95:D:A
hw_addr += len;
*p++ = val;
}