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

Commit 8a31e5ea authored by Pablo Ceballos's avatar Pablo Ceballos Committed by android-build-merger
Browse files

Region: Detect malicious overflow in unflatten am: 1a65fccc am: fd579a51...

Region: Detect malicious overflow in unflatten am: 1a65fccc am: fd579a51 am: 0e85f4d4 am: 0ec362e0 am: b82c6f52
am: e31fd642

Change-Id: I04147fc97057a215e2e50055694be3cc98419490
parents dfd98f98 e31fd642
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -796,6 +796,11 @@ status_t Region::unflatten(void const* buffer, size_t size) {
        return NO_MEMORY;
    }

    if (numRects > (UINT32_MAX / sizeof(Rect))) {
        android_errorWriteWithInfoLog(0x534e4554, "29983260", -1, NULL, 0);
        return NO_MEMORY;
    }

    Region result;
    result.mStorage.clear();
    for (size_t r = 0; r < numRects; ++r) {