Skip to content

Commit dfe5578

Browse files
Irfan SheriffAndroid Git Automerger
authored andcommitted
am c584a24: am 2140d1d: Merge "Avoid system_server crashing due to mac address is null"
* commit 'c584a24ba1af0c831adf46fe57b69af396fb925c': Avoid system_server crashing due to mac address is null
2 parents 98dddda + c584a24 commit dfe5578

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

core/java/android/net/arp/ArpPeer.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,11 @@ public ArpPeer(String interfaceName, InetAddress myAddr, String mac,
5858
mInterfaceName = interfaceName;
5959
mMyAddr = myAddr;
6060

61-
for (int i = 0; i < MAC_ADDR_LENGTH; i++) {
62-
mMyMac[i] = (byte) Integer.parseInt(mac.substring(
63-
i*3, (i*3) + 2), 16);
61+
if (mac != null) {
62+
for (int i = 0; i < MAC_ADDR_LENGTH; i++) {
63+
mMyMac[i] = (byte) Integer.parseInt(mac.substring(
64+
i*3, (i*3) + 2), 16);
65+
}
6466
}
6567

6668
if (myAddr instanceof Inet6Address || peer instanceof Inet6Address) {

0 commit comments

Comments
 (0)