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

Commit 06a3967b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix the wrong condition in querySupportedValues"

parents 8c81f1cf f4b1bcf7
Loading
Loading
Loading
Loading
+9 −11
Original line number Diff line number Diff line
@@ -171,19 +171,17 @@ Return<void> CachedConfigurable::querySupportedValues(
            c2fields,
            mayBlock ? C2_MAY_BLOCK : C2_DONT_BLOCK);
    hidl_vec<FieldSupportedValuesQueryResult> outFields(inFields.size());
    {
        size_t ix = 0;
    size_t dstIx = 0;
    for (const C2FieldSupportedValuesQuery &result : c2fields) {
            if (!objcpy(&outFields[ix], result)) {
                ++ix;
        if (objcpy(&outFields[dstIx], result)) {
            ++dstIx;
        } else {
                outFields.resize(ix);
            outFields.resize(dstIx);
            c2res = C2_CORRUPTED;
            LOG(WARNING) << "querySupportedValues -- invalid output params.";
            break;
        }
    }
    }
    _hidl_cb((Status)c2res, outFields);
    return Void();
}