diff options
author | Ashwini sharma <ak.ashwini1981@gmail.com> | 2014-04-13 16:04:16 -0500 |
---|---|---|
committer | Ashwini sharma <ak.ashwini1981@gmail.com> | 2014-04-13 16:04:16 -0500 |
commit | 1d12fb66550660f97ef90484dc31304eddfd4bf7 (patch) | |
tree | 144523af77516b67da3acbe8dbc97dd58e85a4de | |
parent | 0d8467b371d93bff03f59a8f11f01094f7618372 (diff) | |
download | toybox-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.c | 2 |
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; } |