Skip to content
Snippets Groups Projects
Commit ad0ead34 authored by Ashish Jain's avatar Ashish Jain Committed by nevill_jiang
Browse files

ASoC: msm: qdsp6v2: DAP: Add check to validate data length


Validate input data length to ensure only relevant data
is copied.

CRs-Fixed: 1027585
Change-Id: I67eb4f162f944bbf4d9e55fb8fe93759e6b8ff91
Signed-off-by: default avatarAshish Jain <ashishj@codeaurora.org>
parent bb3d4686
Branches
Tags
No related merge requests found
...@@ -1530,6 +1530,14 @@ static int msm_ds2_dap_get_param(u32 cmd, void *arg) ...@@ -1530,6 +1530,14 @@ static int msm_ds2_dap_get_param(u32 cmd, void *arg)
goto end; goto end;
} }
/* Return if invalid length */
if (dolby_data->length >
(DOLBY_MAX_LENGTH_INDIVIDUAL_PARAM - DOLBY_PARAM_PAYLOAD_SIZE)) {
pr_err("Invalid length %d", dolby_data->length);
rc = -EINVAL;
goto end;
}
for (i = 0; i < DS2_DEVICES_ALL; i++) { for (i = 0; i < DS2_DEVICES_ALL; i++) {
if ((dev_map[i].active) && if ((dev_map[i].active) &&
(dev_map[i].device_id & dolby_data->device_id)) { (dev_map[i].device_id & dolby_data->device_id)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment