mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-23 13:09:04 -04:00
qcacmn: Check pcl array size against QDF_MAX_NUM_CHAN
While populating preferred channel list array, length has not been checked against QDF_MAX_NUM_CHAN which is size of PCL. Fix it by checking indices and length against QDF_MAX_NUM_CHAN CRs-Fixed: 2169424 Change-Id: I8c4d050bfc7040fba052eb42b32a91302a0a0ecb
This commit is contained in:
parent
e91dd92e8b
commit
5428570e41
1 changed files with 5 additions and 1 deletions
|
|
@ -1540,6 +1540,10 @@ QDF_STATUS policy_mgr_modify_sap_pcl_based_on_mandatory_channel(
|
|||
|
||||
for (i = 0; i < *pcl_len_org; i++) {
|
||||
found = false;
|
||||
if (i >= QDF_MAX_NUM_CHAN) {
|
||||
policy_mgr_debug("index is exceeding QDF_MAX_NUM_CHAN");
|
||||
break;
|
||||
}
|
||||
for (j = 0; j < pm_ctx->sap_mandatory_channels_len; j++) {
|
||||
if (pcl_list_org[i] ==
|
||||
pm_ctx->sap_mandatory_channels[j]) {
|
||||
|
|
@ -1547,7 +1551,7 @@ QDF_STATUS policy_mgr_modify_sap_pcl_based_on_mandatory_channel(
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (found) {
|
||||
if (found && (pcl_len < QDF_MAX_NUM_CHAN)) {
|
||||
pcl_list[pcl_len] = pcl_list_org[i];
|
||||
weight_list[pcl_len++] = weight_list_org[i];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue