Fix bug in MacAddress.fromString()
Test: runtest frameworks-net Bug: 69390696 Change-Id: I83f01e4915092e08ed201d9b6738bb02498d3bba
This commit is contained in:
parent
b592c42328
commit
06d9bd1560
1 changed files with 5 additions and 3 deletions
|
|
@ -280,9 +280,8 @@ public final class MacAddress implements Parcelable {
|
|||
throw new IllegalArgumentException(addr + " was not a valid MAC address");
|
||||
}
|
||||
long longAddr = 0;
|
||||
int index = ETHER_ADDR_LEN;
|
||||
while (index-- > 0) {
|
||||
int x = Integer.valueOf(parts[index], 16);
|
||||
for (int i = 0; i < parts.length; i++) {
|
||||
int x = Integer.valueOf(parts[i], 16);
|
||||
if (x < 0 || 0xff < x) {
|
||||
throw new IllegalArgumentException(addr + "was not a valid MAC address");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue