Преглед на файлове

qcacmn: handle integer underflow in util_gen_new_ie

handle integer underflow for subie_len in util_gen_new_ie

Change-Id: I2f73e5a7e0462100deae1e85e6a51f77bfc46b95
CRs-Fixed: 3582487
Guru Pratap Sharma преди 1 година
родител
ревизия
dbd510c42c
променени са 1 файла, в които са добавени 3 реда и са изтрити 2 реда
  1. 3 2
      umac/scan/dispatcher/src/wlan_scan_utils_api.c

+ 3 - 2
umac/scan/dispatcher/src/wlan_scan_utils_api.c

@@ -3074,8 +3074,9 @@ static uint32_t util_gen_new_ie(uint8_t *ie, uint32_t ielen,
 	 * copied to new ie, skip ssid, capability, bssid-index ie
 	 */
 	tmp_new = sub_copy;
-	while (((tmp_new + tmp_new[1] + MIN_IE_LEN) - sub_copy) <=
-	       (subie_len - 1)) {
+	while ((subie_len > 0) &&
+	       (((tmp_new + tmp_new[1] + MIN_IE_LEN) - sub_copy) <=
+		(subie_len - 1))) {
 		if (!(tmp_new[0] == WLAN_ELEMID_NONTX_BSSID_CAP ||
 		      tmp_new[0] == WLAN_ELEMID_SSID ||
 		      tmp_new[0] == WLAN_ELEMID_MULTI_BSSID_IDX ||