Pārlūkot izejas kodu

qcacmn: Fix memory access out of bounds when sort 6g channel list

In arch 32 platform, the size of rnr_chan_info is 8 bytes, and it only
allocates 4 bytes for each of them. Which cause memory access out of
bounds.

Change-Id: I4f1798c5354c6a76e32bdfed13ade9667465b789
CRs-Fixed: 2827289
Wu Gao 4 gadi atpakaļ
vecāks
revīzija
2f09a8e245
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      umac/scan/core/src/wlan_scan_manager_6ghz.c

+ 1 - 1
umac/scan/core/src/wlan_scan_manager_6ghz.c

@@ -75,7 +75,7 @@ scm_sort_6ghz_channel_list(struct wlan_objmgr_vdev *vdev,
 	if (tmp_list_count <= 1)
 		return;
 
-	rnr_chan_info = qdf_mem_malloc(sizeof(rnr_chan_info) * tmp_list_count);
+	rnr_chan_info = qdf_mem_malloc(sizeof(*rnr_chan_info) * tmp_list_count);
 	if (!rnr_chan_info)
 		return;