summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/hdd/src/wlan_hdd_ext_scan.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/hdd/src/wlan_hdd_ext_scan.c b/core/hdd/src/wlan_hdd_ext_scan.c
index 6e513c4662d7..1c06b5bc6aca 100644
--- a/core/hdd/src/wlan_hdd_ext_scan.c
+++ b/core/hdd/src/wlan_hdd_ext_scan.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -4534,6 +4534,12 @@ __wlan_hdd_cfg80211_extscan_set_ssid_hotlist(struct wiphy *wiphy,
ssid_str_len = nla_strlcpy(ssid_string,
tb2[PARAM_SSID],
sizeof(ssid_string));
+ /* nla_parse will detect overflow but not underflow */
+ if (0 == ssid_str_len) {
+ hdd_err("zero ssid length");
+ goto fail;
+ }
+
if (ssid_str_len > SIR_MAC_MAX_SSID_LENGTH) {
hdd_err("Invalid length exceeds max ssid length");
goto fail;