summaryrefslogtreecommitdiffstats
path: root/wifi
diff options
context:
space:
mode:
authorvandwalle <vandwalle@google.com>2014-05-08 17:20:23 -0700
committerLorenzo Colitti <lorenzo@google.com>2014-05-09 00:43:35 +0000
commit60a28c6c4b992d1d3959484442a205d6ae2bd977 (patch)
tree39642b6ea4b4e3581739901971c7773edf4c66ce /wifi
parentca0c0ba76488ad287e83228ba78d4e46524564aa (diff)
downloadframeworks_base-60a28c6c4b992d1d3959484442a205d6ae2bd977.zip
frameworks_base-60a28c6c4b992d1d3959484442a205d6ae2bd977.tar.gz
frameworks_base-60a28c6c4b992d1d3959484442a205d6ae2bd977.tar.bz2
Don't crash when asked to enable an AP with a null SSID.
WifiConfiguration can have been build by an app with a NULL SSID, or other null fields. We need to verify that at least that those fields are not NULL before using them. More specifically, don't crash when enabling an AP with a null SSID in setApConfiguration function. Bug: 14568953 Change-Id: I6b33ddf97789c0ee4b850d3ec0bccb08100c21d5
Diffstat (limited to 'wifi')
-rw-r--r--wifi/java/android/net/wifi/WifiConfiguration.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java
index ce8c8b8..85b81d9 100644
--- a/wifi/java/android/net/wifi/WifiConfiguration.java
+++ b/wifi/java/android/net/wifi/WifiConfiguration.java
@@ -506,6 +506,12 @@ public class WifiConfiguration implements Parcelable {
* @hide
*/
public boolean isValid() {
+ if (SSID == null)
+ return false;
+
+ if (allowedKeyManagement == null)
+ return false;
+
if (allowedKeyManagement.cardinality() > 1) {
if (allowedKeyManagement.cardinality() != 2) {
return false;