From 1e45f2f13c0e5b5a1d595da0df0dc57bd1aca93f Mon Sep 17 00:00:00 2001 From: c_rrajiv Date: Wed, 25 Mar 2015 12:12:29 +0530 Subject: wifi: Handle the NULL check for the STATUS command STATUS command is issued to the supplicant to get the currently connected network status. The current code does not consider the failure scenario (NULL check) for the obtained response and this commit handles the same. Change-Id: I4d90386bf8d909c97cacdf5b9c80e07a679d63ee CRs-Fixed: 811537 --- service/java/com/android/server/wifi/WifiAutoJoinController.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'service') diff --git a/service/java/com/android/server/wifi/WifiAutoJoinController.java b/service/java/com/android/server/wifi/WifiAutoJoinController.java index d7a88fbc3..c8fbc8dc9 100644 --- a/service/java/com/android/server/wifi/WifiAutoJoinController.java +++ b/service/java/com/android/server/wifi/WifiAutoJoinController.java @@ -1298,6 +1298,10 @@ public class WifiAutoJoinController { // Find the currently connected network: ask the supplicant directly String val = mWifiNative.status(true); + if (val == null) { + if (VDBG) logDbg("wpa_supplicant's STATUS command Failure"); + return false; + } String status[] = val.split("\\r?\\n"); if (VDBG) { logDbg("attemptAutoJoin() status=" + val + " split=" -- cgit v1.2.3