mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 20:33:58 -04:00
qcacmn: Fetch thermal_stats in array range
Since lvl_idx maybe get value large than param_buf->num_temp_range_stats, then out of bounds will happen when read array of wmi_tt_stats. Change-Id: I85b29216272952102dca41792c290baf285a8e31 CRs-Fixed: 3136333
This commit is contained in:
parent
48de2db910
commit
e2e7af2eaf
1 changed files with 7 additions and 0 deletions
|
|
@ -11500,6 +11500,13 @@ populate_thermal_stats(WMI_THERM_THROT_STATS_EVENTID_param_tlvs *param_buf,
|
|||
WMI_THERMAL_STATS_TEMP_THRESH_LEVEL_MAX :
|
||||
tt_stats_event->therm_throt_levels;
|
||||
|
||||
if (*therm_throt_levels > param_buf->num_temp_range_stats) {
|
||||
wmi_err("therm_throt_levels:%u oob num_temp_range_stats:%u",
|
||||
*therm_throt_levels,
|
||||
param_buf->num_temp_range_stats);
|
||||
return;
|
||||
}
|
||||
|
||||
wmi_tt_stats = param_buf->temp_range_stats;
|
||||
if (!wmi_tt_stats) {
|
||||
wmi_err("wmi_tt_stats Null");
|
||||
|
|
|
|||
Loading…
Reference in a new issue