OSDN Git Service

DhcpClient: guard against failure to parse packets
authorHugo Benichi <hugobenichi@google.com>
Tue, 11 Oct 2016 02:39:39 +0000 (11:39 +0900)
committerHugo Benichi <hugobenichi@google.com>
Mon, 24 Oct 2016 06:40:30 +0000 (15:40 +0900)
commit89aa6fb4d87b5a279150f15ad1f9bcfa03e3a261
tree411954bb7a92bf953358b6c61a127474269a1c9a
parent5d1bfd9d5f1251b91525641d7980e38f0379f7f0
DhcpClient: guard against failure to parse packets

DhcpPacket.decodeFullPacket() is not exception safe and can throw
various runtime exceptions when trying to parse malicious or malformed
packets.

This patch adds a generic catch-all-exception in DhcpClient to avoid
propagating the exception and killing the framework process on reception
of such malformed packets.

Bug: 31850211
Change-Id: I2e723a792ff067ada2834da875700d4df16c5159
services/net/java/android/net/dhcp/DhcpClient.java