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

Commit af55335d authored by rago's avatar rago Committed by android-build-merger
Browse files

Fix security vulnerability: Effect command might allow negative indexes am:...

Fix security vulnerability: Effect command might allow negative indexes am: 01183402 am: 94e3424b am: 9bf3487e am: d4881f84 am: f31abe2c am: 0905c40e am: 7b4d7904 am: a6323b04 am: d8383694 am: e92a0c60 am: 3712921a am: df9b8955
am: 3939df61

Change-Id: Ie8d3167ba9e72a343ae0682682de5c22a181f2ea
parents 5c9ef550 3939df61
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -2419,9 +2419,13 @@ int Equalizer_getParameter(EffectContext *pContext,

    case EQ_PARAM_GET_PRESET_NAME:
        param2 = *pParamTemp;
        if (param2 >= EqualizerGetNumPresets()) {
        //if (param2 >= 20) {     // AGO FIX
        if ((param2 < 0 && param2 != PRESET_CUSTOM) ||  param2 >= EqualizerGetNumPresets()) {
            status = -EINVAL;
            if (param2 < 0) {
                android_errorWriteLog(0x534e4554, "32448258");
                ALOGE("\tERROR Equalizer_getParameter() EQ_PARAM_GET_PRESET_NAME preset %d",
                        param2);
            }
            break;
        }
        name = (char *)pValue;
@@ -2491,8 +2495,12 @@ int Equalizer_setParameter (EffectContext *pContext, void *pParam, void *pValue)
        band =  *pParamTemp;
        level = (int32_t)(*(int16_t *)pValue);
        //ALOGV("\tEqualizer_setParameter() EQ_PARAM_BAND_LEVEL band %d, level %d", band, level);
        if (band >= FIVEBAND_NUMBANDS) {
        if (band < 0 || band >= FIVEBAND_NUMBANDS) {
            status = -EINVAL;
            if (band < 0) {
                android_errorWriteLog(0x534e4554, "32095626");
                ALOGE("\tERROR Equalizer_setParameter() EQ_PARAM_BAND_LEVEL band %d", band);
            }
            break;
        }
        EqualizerSetBandLevel(pContext, band, level);