From 6136d3e5f7a937d22ca70ef209bb11d5f362fd7c Mon Sep 17 00:00:00 2001 From: Srinivas Girigowda Date: Fri, 6 Jan 2017 11:03:54 -0800 Subject: 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 --- core/hdd/src/wlan_hdd_ext_scan.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3