Преглед изворни кода

qcacld-3.0: Add check in policy_mgr_dump_channel_list

Add check in policy_mgr_dump_channel_list to restrict the
pcl_channels array index to NUM_CHANNELS & len while printing
2G/5G and 6G channel list as pcl_channels is initialized
with size of NUM_CHANNELS.

Change-Id: I5ca573d1c12970974cbb09c5d25f816e2d6c1de5
CRs-Fixed: 2706882
Utkarsh Bhatnagar пре 4 година
родитељ
комит
2a74a1d231
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c

+ 2 - 2
components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c

@@ -2486,7 +2486,7 @@ bool policy_mgr_dump_channel_list(uint32_t len, uint32_t *pcl_channels,
 		return false;
 
 	policymgr_nofl_debug("Total PCL Chan Freq %d", len);
-	for (idx = 0; idx < len; idx++) {
+	for (idx = 0; (idx < len) && (idx < NUM_CHANNELS); idx++) {
 		if (!WLAN_REG_IS_6GHZ_CHAN_FREQ(pcl_channels[idx])) {
 			num += qdf_scnprintf(chan_buff + num, buff_len - num,
 					     " %d[%d]", pcl_channels[idx],
@@ -2512,7 +2512,7 @@ bool policy_mgr_dump_channel_list(uint32_t len, uint32_t *pcl_channels,
 
 	count = 0;
 	num = 0;
-	for (idx = 0; idx < len; idx++) {
+	for (idx = 0; (idx < len) && (idx < NUM_CHANNELS); idx++) {
 		if (WLAN_REG_IS_6GHZ_CHAN_FREQ(pcl_channels[idx])) {
 			num += qdf_scnprintf(chan_buff + num, buff_len - num,
 					     " %d[%d]", pcl_channels[idx],