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

Commit e55af01f authored by Devin Moore's avatar Devin Moore Committed by Automerger Merge Worker
Browse files

Check for malformed Sensor Flattenable am: d1fe3644

parents fd8f1371 d1fe3644
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -612,7 +612,13 @@ bool Sensor::unflattenString8(void const*& buffer, size_t& size, String8& output
        return false;
    }
    outputString8.setTo(static_cast<char const*>(buffer), len);

    if (size < FlattenableUtils::align<4>(len)) {
        ALOGE("Malformed Sensor String8 field. Should be in a 4-byte aligned buffer but is not.");
        return false;
    }
    FlattenableUtils::advance(buffer, size, FlattenableUtils::align<4>(len));

    return true;
}