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

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

Check for malformed Sensor Flattenable am: 962b5a4d am: 938eb4a7

parents 72f8fc79 938eb4a7
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -632,7 +632,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;
}