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

Commit 318c7278 authored by Santiago Seifert's avatar Santiago Seifert Committed by Automerger Merge Worker
Browse files

Prevent out-of-bounds vector access am: aff26637

parents 04ba9a4d aff26637
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -102,10 +102,11 @@ template <typename T>
static bool findParam(uint32_t key, T *param,
        KeyedVector<uint32_t, uint64_t> &params) {
    CHECK(param);
    if (params.indexOfKey(key) < 0) {
    ssize_t index = params.indexOfKey(key);
    if (index < 0) {
        return false;
    }
    *param = (T) params[key];
    *param = (T) params[index];
    return true;
}