From 781fa6d27f15a1e3b8cc3d3cd7aaa63b38c8d56e Mon Sep 17 00:00:00 2001 From: Glen Kuhne Date: Fri, 7 Apr 2017 13:49:18 -0700 Subject: Fix START_WPS null exception Fixed an uncaught null being passed in through the startWps API. Bug: 36491634 Test: Added a unit test Change-Id: Ic8f5cec9d43332b4c8701582455e662a6f885f20 --- service/java/com/android/server/wifi/WifiStateMachine.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'service') diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java index 39ece2931..26b3c38fa 100644 --- a/service/java/com/android/server/wifi/WifiStateMachine.java +++ b/service/java/com/android/server/wifi/WifiStateMachine.java @@ -5101,6 +5101,11 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiRss break; case WifiManager.START_WPS: WpsInfo wpsInfo = (WpsInfo) message.obj; + if (wpsInfo == null) { + loge("Cannot start WPS with null WpsInfo object"); + replyToMessage(message, WifiManager.WPS_FAILED, WifiManager.ERROR); + break; + } WpsResult wpsResult = new WpsResult(); // TODO(b/32898136): Not needed when we start deleting networks from supplicant // on disconnect. -- cgit v1.2.3