diff --git a/core/mac/src/pe/lim/lim_mlo.c b/core/mac/src/pe/lim/lim_mlo.c index 2422e792a8..59ea762735 100644 --- a/core/mac/src/pe/lim/lim_mlo.c +++ b/core/mac/src/pe/lim/lim_mlo.c @@ -51,7 +51,7 @@ QDF_STATUS lim_cu_info_from_rnr_per_link_id(const uint8_t *rnr, rnr_end = rnr + rnr[TAG_LEN_POS] + MIN_IE_LEN; data = rnr + PAYLOAD_START_POS; - while (data < rnr_end) { + while ((data + sizeof(struct neighbor_ap_info_field)) <= rnr_end) { neighbor_ap_info = (struct neighbor_ap_info_field *)data; tbtt_count = neighbor_ap_info->tbtt_header.tbtt_info_count; tbtt_len = neighbor_ap_info->tbtt_header.tbtt_info_length;