summaryrefslogtreecommitdiffstats
path: root/voice_processing/voice_processing.c
diff options
context:
space:
mode:
Diffstat (limited to 'voice_processing/voice_processing.c')
-rw-r--r--voice_processing/voice_processing.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/voice_processing/voice_processing.c b/voice_processing/voice_processing.c
index 90034115..f01a107e 100644
--- a/voice_processing/voice_processing.c
+++ b/voice_processing/voice_processing.c
@@ -564,7 +564,9 @@ static int fx_command(effect_handle_t self,
if (pCmdData == NULL ||
cmdSize < (int)sizeof(effect_param_t) ||
pReplyData == NULL ||
- *replySize < (int)sizeof(effect_param_t)) {
+ *replySize < (int)sizeof(effect_param_t) ||
+ // constrain memcpy below
+ ((effect_param_t *)pCmdData)->psize > *replySize - sizeof(effect_param_t)) {
ALOGV("fx_command() EFFECT_CMD_GET_PARAM invalid args");
return -EINVAL;
}