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

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

Check for malformed Sensor Flattenable am: 1ee72ac9

parents cea3cc91 1ee72ac9
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -628,7 +628,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;
}