qcacmn: Fix length check to parse non-inheritance list

Fix length check and add sub_copy and length
subie_len checks before accessing extn_elem to avoid any
OOB read.

Change-Id: I85ea636d5fe64e8508e91b06f0302d5f6258e583
CRs-Fixed: 3800831
This commit is contained in:
Kaushik K.N 2024-05-09 09:25:57 +02:00 • committed by Ravindra Konda
commit a2450eb8bc

View file

@ -2019,7 +2019,7 @@ static uint32_t util_gen_new_ie(uint8_t *ie, uint32_t ielen,
if (extn_elem && extn_elem[TAG_LEN_POS] >= VALID_ELEM_LEAST_LEN) {
if (((extn_elem + extn_elem[1] + MIN_IE_LEN) - sub_copy)
< subie_len)
<= subie_len)
util_parse_noninheritance_list(extn_elem, &elem_list,
&extn_elem_list, &ninh);
}