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

Commit 2758eb2e authored by Michael Lentine's avatar Michael Lentine Committed by Android Git Automerger
Browse files

am fde92eb0: Update maxNumber to be smaller.

* commit 'fde92eb0':
  Update maxNumber to be smaller.
parents 3d89edca fde92eb0
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -250,7 +250,11 @@ status_t GraphicBuffer::unflatten(void const* buffer, size_t size,
    const size_t numFds  = buf[6];
    const size_t numInts = buf[7];

    const size_t maxNumber = UINT_MAX / sizeof(int);
    // Limit the maxNumber to be relatively small. The number of fds or ints
    // should not come close to this number, and the number itself was simply
    // chosen to be high enough to not cause issues and low enough to prevent
    // overflow problems.
    const size_t maxNumber = 4096;
    if (numFds >= maxNumber || numInts >= (maxNumber - 10)) {
        width = height = stride = format = usage = 0;
        handle = NULL;