diff options
author | Stan Chesnutt <chesnutt@google.com> | 2011-02-02 12:10:21 -0800 |
---|---|---|
committer | Stan Chesnutt <chesnutt@google.com> | 2011-02-02 12:10:21 -0800 |
commit | 045b166ac27c3b7a67993b029f03088042bf4d5a (patch) | |
tree | 6d644591b9d4df318dc482f0461db744a80b1184 /core/java | |
parent | dd1729b9e61556e546d3051f6dbb802e25fda5bd (diff) | |
download | frameworks_base-045b166ac27c3b7a67993b029f03088042bf4d5a.zip frameworks_base-045b166ac27c3b7a67993b029f03088042bf4d5a.tar.gz frameworks_base-045b166ac27c3b7a67993b029f03088042bf4d5a.tar.bz2 |
Provide an empty List of dns servers, protecting against an NPE if the
DHCP server omits the list of DNS servers from the DHCP-OFFER packet.
Change-Id: I4cdb3d47f36ecceaef390948741c0632067ee8ba
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/net/dhcp/DhcpPacket.java | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/core/java/android/net/dhcp/DhcpPacket.java b/core/java/android/net/dhcp/DhcpPacket.java index e009f70..7d2bd69 100644 --- a/core/java/android/net/dhcp/DhcpPacket.java +++ b/core/java/android/net/dhcp/DhcpPacket.java @@ -561,7 +561,7 @@ abstract class DhcpPacket { InetAddress nextIp; InetAddress relayIp; byte[] clientMac; - List<InetAddress> dnsServers = null; + List<InetAddress> dnsServers = new ArrayList<InetAddress>(); InetAddress gateway = null; // aka router Integer leaseTime = null; InetAddress serverIdentifier = null; @@ -684,7 +684,6 @@ abstract class DhcpPacket { expectedLen = 4; break; case DHCP_DNS_SERVER: - dnsServers = new ArrayList<InetAddress>(); expectedLen = 0; for (expectedLen = 0; expectedLen < optionLen; |