Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8d029bff authored by Andy Hung's avatar Andy Hung Committed by Android (Google) Code Review
Browse files

Merge "Effects: Check get parameter command size"

parents afe53b6b 6660f12f
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -602,6 +602,13 @@ status_t AudioFlinger::EffectModule::command(uint32_t cmdCode,
        android_errorWriteLog(0x534e4554, "29251553");
        return -EINVAL;
    }
    if (cmdCode == EFFECT_CMD_GET_PARAM &&
            (sizeof(effect_param_t) > cmdSize ||
                    ((effect_param_t *)pCmdData)->psize > cmdSize
                                                          - sizeof(effect_param_t))) {
        android_errorWriteLog(0x534e4554, "32438594");
        return -EINVAL;
    }
    if ((cmdCode == EFFECT_CMD_SET_PARAM
            || cmdCode == EFFECT_CMD_SET_PARAM_DEFERRED) &&  // DEFERRED not generally used
        (sizeof(effect_param_t) > cmdSize