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

Commit c634a513 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Fix security vulnerability: Equalizer command might allow negative...

Merge "Fix security vulnerability: Equalizer command might allow negative indexes" into audio-userspace.lnx.2.2-dev
parents 68e5a7d9 3ef61e2e
Loading
Loading
Loading
Loading
+16 −4
Original line number Original line Diff line number Diff line
@@ -274,8 +274,12 @@ int equalizer_get_parameter(effect_context_t *context, effect_param_t *p,


    case EQ_PARAM_BAND_LEVEL:
    case EQ_PARAM_BAND_LEVEL:
        param2 = *param_tmp;
        param2 = *param_tmp;
        if (param2 >= NUM_EQ_BANDS) {
        if (param2 < 0 || param2 >= NUM_EQ_BANDS) {
            p->status = -EINVAL;
            p->status = -EINVAL;
            if (param2 < 0) {
                android_errorWriteLog(0x534e4554, "32438598");
                ALOGW("\tERROR EQ_PARAM_BAND_LEVEL band %d", param2);
            }
            break;
            break;
        }
        }
        *(int16_t *)value = (int16_t)equalizer_get_band_level(eq_ctxt, param2);
        *(int16_t *)value = (int16_t)equalizer_get_band_level(eq_ctxt, param2);
@@ -283,8 +287,12 @@ int equalizer_get_parameter(effect_context_t *context, effect_param_t *p,


    case EQ_PARAM_CENTER_FREQ:
    case EQ_PARAM_CENTER_FREQ:
        param2 = *param_tmp;
        param2 = *param_tmp;
        if (param2 >= NUM_EQ_BANDS) {
        if (param2 < 0 || param2 >= NUM_EQ_BANDS) {
            p->status = -EINVAL;
            p->status = -EINVAL;
            if (param2 < 0) {
                android_errorWriteLog(0x534e4554, "32436341");
                ALOGW("\tERROR EQ_PARAM_CENTER_FREQ band %d", param2);
            }
            break;
            break;
        }
        }
        *(int32_t *)value = equalizer_get_center_frequency(eq_ctxt, param2);
        *(int32_t *)value = equalizer_get_center_frequency(eq_ctxt, param2);
@@ -292,8 +300,12 @@ int equalizer_get_parameter(effect_context_t *context, effect_param_t *p,


    case EQ_PARAM_BAND_FREQ_RANGE:
    case EQ_PARAM_BAND_FREQ_RANGE:
        param2 = *param_tmp;
        param2 = *param_tmp;
        if (param2 >= NUM_EQ_BANDS) {
        if (param2 < 0 || param2 >= NUM_EQ_BANDS) {
            p->status = -EINVAL;
            p->status = -EINVAL;
            if (param2 < 0) {
                android_errorWriteLog(0x534e4554, "32247948");
                ALOGW("\tERROR EQ_PARAM_BAND_FREQ_RANGE band %d", param2);
            }
           break;
           break;
        }
        }
       equalizer_get_band_freq_range(eq_ctxt, param2, (uint32_t *)value,
       equalizer_get_band_freq_range(eq_ctxt, param2, (uint32_t *)value,