mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-31 13:40:08 +01:00
CVE-2007-6429: Always test for size+offset wrapping.
(cherry picked from commit be6c17fcf9)
This commit is contained in:
parent
514c622618
commit
5ef366e8eb
1 changed files with 6 additions and 6 deletions
12
Xext/shm.c
12
Xext/shm.c
|
|
@ -761,10 +761,10 @@ CreatePmap:
|
|||
if (sizeof(size) == 4 && BitsPerPixel(depth) > 8) {
|
||||
if (size < width * height)
|
||||
return BadAlloc;
|
||||
/* thankfully, offset is unsigned */
|
||||
if (stuff->offset + size < size)
|
||||
return BadAlloc;
|
||||
}
|
||||
/* thankfully, offset is unsigned */
|
||||
if (stuff->offset + size < size)
|
||||
return BadAlloc;
|
||||
|
||||
VERIFY_SHMSIZE(shmdesc, stuff->offset, size, client);
|
||||
|
||||
|
|
@ -1101,10 +1101,10 @@ CreatePmap:
|
|||
if (sizeof(size) == 4 && BitsPerPixel(depth) > 8) {
|
||||
if (size < width * height)
|
||||
return BadAlloc;
|
||||
/* thankfully, offset is unsigned */
|
||||
if (stuff->offset + size < size)
|
||||
return BadAlloc;
|
||||
}
|
||||
/* thankfully, offset is unsigned */
|
||||
if (stuff->offset + size < size)
|
||||
return BadAlloc;
|
||||
|
||||
VERIFY_SHMSIZE(shmdesc, stuff->offset, size, client);
|
||||
pMap = (*shmFuncs[pDraw->pScreen->myNum]->CreatePixmap)(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue