* commit '2758eb2e67d935cf1f04e3d713438c6ac7fe8b89': Update maxNumber to be smaller.
This commit is contained in:
commit
da9fd70de1
@ -251,7 +251,11 @@ status_t GraphicBuffer::unflatten(
|
|||||||
const size_t numFds = buf[6];
|
const size_t numFds = buf[6];
|
||||||
const size_t numInts = buf[7];
|
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)) {
|
if (numFds >= maxNumber || numInts >= (maxNumber - 10)) {
|
||||||
width = height = stride = format = usage = 0;
|
width = height = stride = format = usage = 0;
|
||||||
handle = NULL;
|
handle = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user