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

Commit 892e6026 authored by Chia-I Wu's avatar Chia-I Wu Committed by android-build-merger
Browse files

libui: add boundary check to GraphicBuffer::unflatten am: bf8d7210 am: 11ed3dcc am: e2393365

am: fa2d892c

Change-Id: I12624ad73b446c6c36130a1b017d01be95905150
parents 696d3d46 fa2d892c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -376,6 +376,10 @@ status_t GraphicBuffer::flatten(void*& buffer, size_t& size, int*& fds, size_t&

status_t GraphicBuffer::unflatten(
        void const*& buffer, size_t& size, int const*& fds, size_t& count) {
    if (size < 12 * sizeof(int)) {
        android_errorWriteLog(0x534e4554, "114223584");
        return NO_MEMORY;
    }

    int const* buf = static_cast<int const*>(buffer);