asoc: common: correct buffer overflow array index Out of Bounds
Add range check for ch_cnt value to avoid buffer overflow. Change-Id: Iad18ea2fa42057211dc98c9d80465687cbc62776
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

parent
6642ce7a89
commit
42e49611b0
@@ -836,6 +836,10 @@ int msm_channel_map_get(struct snd_kcontrol *kcontrol,
|
||||
chmap = tx_ch;
|
||||
ch_cnt = tx_ch_cnt;
|
||||
}
|
||||
if (ch_cnt > 2) {
|
||||
pr_err("%s: Incorrect channel count: %d\n", ch_cnt);
|
||||
return -EINVAL;
|
||||
}
|
||||
len = sizeof(uint32_t) * (ch_cnt + 1);
|
||||
chmap_data = kzalloc(len, GFP_KERNEL);
|
||||
if (!chmap_data)
|
||||
|
Reference in New Issue
Block a user