summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRajeev Kumar Sirasanagandla <rsirasan@codeaurora.org>2017-04-07 18:47:50 +0530
committerSandeep Puligilla <spuligil@codeaurora.org>2017-04-11 23:55:36 -0700
commit6f70e69b44aa8d5019e61ec4eaddc4d6fb120790 (patch)
tree452cd9df5ec7ebf1817337706d6f55fb0a840c58
parent073d2e1b45b29a6d5dad58e0f4e2ae07a275a48e (diff)
qcacld-3.0: Get valid number of OUI string
qcacld-2.0 to qcacld-3.0 propagation If input some particular value of OUIS in configure file, it can’t work well as expected. Currently in function hdd_parse_probe_req_ouis, if there is an invalid OUI string in the configure file, the valid OUI strings will also be ignored. If there are 17 valid OUI strings, it will save 17 count of OUIS and overflow access the voui array. If there are more than 17 valid OUI strings, nothing will be saved. To address this, reset the counters when invalid string is found and add check to limit valid OUI strings upto MAX_PROBE_REQ_OUIS. Change-Id: Ib4b6d95e9b8290450e620ef390d74743891c3c02 CRs-Fixed: 1111168
-rw-r--r--core/hdd/src/wlan_hdd_cfg.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c
index 03fb36326cfe..73ffca60dc8c 100644
--- a/core/hdd/src/wlan_hdd_cfg.c
+++ b/core/hdd/src/wlan_hdd_cfg.c
@@ -7983,18 +7983,19 @@ int hdd_parse_probe_req_ouis(hdd_context_t *hdd_ctx)
memcpy(temp, &str[i - 8], 8);
i++;
temp[8] = '\0';
- if (hdd_probe_req_voui_convert_to_hex(temp,
- &voui[oui_indx]) == 0) {
+ if (!hdd_probe_req_voui_convert_to_hex(temp,
+ &voui[oui_indx])) {
+ end = start = 0;
continue;
}
oui_indx++;
- if (oui_indx > MAX_PROBE_REQ_OUIS) {
+ if (oui_indx >= MAX_PROBE_REQ_OUIS) {
/*
* Max number of OUIs supported is 16,
* ignoring the rest
*/
hdd_info("Max OUIs-supported: 16");
- return 0;
+ break;
}
}
start = end = 0;
@@ -8004,11 +8005,11 @@ int hdd_parse_probe_req_ouis(hdd_context_t *hdd_ctx)
}
}
- if ((end - start) == 8) {
+ if (((end - start) == 8) && oui_indx < MAX_PROBE_REQ_OUIS) {
memcpy(temp, &str[i - 8], 8);
temp[8] = '\0';
if (hdd_probe_req_voui_convert_to_hex(temp,
- &voui[oui_indx]) == 1)
+ &voui[oui_indx]))
oui_indx++;
}