summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorGlen Kuhne <kuh@google.com>2017-04-07 13:49:18 -0700
committerGlen Kuhne <kuh@google.com>2017-04-10 13:39:02 -0700
commit781fa6d27f15a1e3b8cc3d3cd7aaa63b38c8d56e (patch)
tree3b7054cd0ee09f32fa847289ef2fe74ad4a92f0c /service
parent5ed0a08cce018a10dce2b84f7d818e0f12c09f15 (diff)
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
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiStateMachine.java5
1 files changed, 5 insertions, 0 deletions
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.