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

Commit abd6e9d8 authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

libaudioclient: Fix error handling in AudioEffect::set

Zero-initialize effect UUID string recipient arrays
to prevent logging random data.

Bug: 152189317
Test: m
Change-Id: I70e6cd509d7c4d1ce1cbd3a250b1371d2d5af4a7
parent 3006a835
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -151,11 +151,13 @@ status_t AudioEffect::set(const effect_uuid_t *type,
    // audio flinger will not be retained. initCheck() will return the creation status
    // but all other APIs will return invalid operation.
    if (probe || iEffect == 0 || (mStatus != NO_ERROR && mStatus != ALREADY_EXISTS)) {
        char typeBuffer[64], uuidBuffer[64];
        char typeBuffer[64] = {}, uuidBuffer[64] = {};
        guidToString(type, typeBuffer, sizeof(typeBuffer));
        guidToString(uuid, uuidBuffer, sizeof(uuidBuffer));
        ALOGE_IF(!probe, "set(): AudioFlinger could not create effect %s / %s, status: %d",
                typeBuffer, uuidBuffer, mStatus);
                type != nullptr ? typeBuffer : "NULL",
                uuid != nullptr ? uuidBuffer : "NULL",
                mStatus);
        if (!probe && iEffect == 0) {
            mStatus = NO_INIT;
        }