mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 15:49:17 -04:00
qcacmn: Fix array index out of bounds
The 2nd argument passed to the function is_primaryseg_expected is used to index the array spectral->rparams.fragmentation_160 which is of size 2.If the value of the argument is greater than or equal to 2, the indexing will lead to array-out-of-bounds access. The fix is adding the relevant validation check. Change-Id: Iccf98b06c0546ad11ec67e93e14183214100107f
This commit is contained in:
parent
14543e310a
commit
ec3e25bf03
1 changed files with 1 additions and 1 deletions
|
|
@ -1877,7 +1877,7 @@ target_if_consume_spectral_report_gen3(
|
|||
|
||||
spectral_mode = target_if_get_spectral_mode(detector_id,
|
||||
&spectral->rparams);
|
||||
if (spectral_mode == SPECTRAL_SCAN_MODE_INVALID) {
|
||||
if (spectral_mode >= SPECTRAL_SCAN_MODE_MAX) {
|
||||
spectral_err_rl("No valid Spectral mode for detector id %u",
|
||||
detector_id);
|
||||
goto fail;
|
||||
|
|
|
|||
Loading…
Reference in a new issue