Przeglądaj źródła

qcacld-3.0: Avoid out of bound memcopy

While parsing the beacon t2lm ie, avoid out
of bound memcopy.

Change-Id: I2db28b2a17efe0e8dea328dc76a1a5d98e7555dc
CRs-Fixed: 3575335
Amruta Kulkarni 1 rok temu
rodzic
commit
f92388d27d

+ 2 - 2
core/mac/src/sys/legacy/src/utils/src/parser_api.c

@@ -3917,7 +3917,7 @@ sir_convert_assoc_resp_frame2_t2lm_struct(struct mac_context *mac,
 		ie[TAG_LEN_POS] = ar->t2lm_ie[i].num_data + 1;
 		ie[IDEXT_POS] = WLAN_EXTN_ELEMID_T2LM;
 		qdf_mem_copy(&ie[3], &ar->t2lm_ie[i].data[0],
-			     ar->t2lm_ie[i].num_data + 3);
+			     ar->t2lm_ie[i].num_data);
 		qdf_trace_hex_dump(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG,
 				   &ie[0], ar->t2lm_ie[i].num_data + 3);
 		status = wlan_mlo_parse_t2lm_info(&ie[0], &t2lm);
@@ -5240,7 +5240,7 @@ sir_convert_beacon_frame2_t2lm_struct(tDot11fBeacon *bcn_frm,
 		ie[TAG_LEN_POS] = bcn_frm->t2lm_ie[i].num_data + 1;
 		ie[IDEXT_POS] = WLAN_EXTN_ELEMID_T2LM;
 		qdf_mem_copy(&ie[3], &bcn_frm->t2lm_ie[i].data[0],
-			     bcn_frm->t2lm_ie[i].num_data + 3);
+			     bcn_frm->t2lm_ie[i].num_data);
 		qdf_trace_hex_dump(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG,
 				   &ie[0], bcn_frm->t2lm_ie[i].num_data + 3);
 		status = wlan_mlo_parse_t2lm_info(&ie[0], &t2lm);