Commit 07cd4cdf authored by Pablo Ceballos's avatar Pablo Ceballos Committed by gitbuildkicker
Browse files

Region: Detect malicious overflow in unflatten

Bug 29983260

Change-Id: Ib6e1cb8ae279010c5e9960aaa03513f55b7d873b
parent 54cb02ad
......@@ -795,6 +795,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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment