From 6f70e69b44aa8d5019e61ec4eaddc4d6fb120790 Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Sirasanagandla Date: Fri, 7 Apr 2017 18:47:50 +0530 Subject: qcacld-3.0: Get valid number of OUI string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- core/hdd/src/wlan_hdd_cfg.c | 13 +++++++------ 1 file 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++; } -- cgit v1.2.3