diff options
| author | Srinivas Girigowda <sgirigow@codeaurora.org> | 2017-01-06 11:03:54 -0800 |
|---|---|---|
| committer | qcabuildsw <qcabuildsw@localhost> | 2017-01-12 02:19:30 -0800 |
| commit | 6136d3e5f7a937d22ca70ef209bb11d5f362fd7c (patch) | |
| tree | 737cba44f73247d10d851f57ca8b045b889f7ebb | |
| parent | e2dc368517d2800b5b67ef8d2a435b8303f0ce10 (diff) | |
qcacld-3.0: Check for zero length ssid
This is a qcacld-2.0 to qcacld-3.0 propagation.
nla_parse() will detect overflow but not underflow,
Add a check for zero length ssid.
Change-Id: I83f350f81f206a7a8c3ed7f1b5872e6cf995ae81
CRs-Fixed: 1059205
| -rw-r--r-- | core/hdd/src/wlan_hdd_ext_scan.c | 8 |
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; |
