| author | Matthias Hopf <mhopf@suse.de> | 2008-01-21 15:13:21 (GMT) |
|---|---|---|
| committer | Matthias Hopf <mhopf@suse.de> | 2008-01-21 15:13:21 (GMT) |
| commit | be6c17fcf9efebc0bbcc3d9a25f8c5a2450c2161 (patch) | |
| tree | 169d58ce010bfeb145542d540cfaa92b35c8dcf5 | |
| parent | 94a21d757ce58254accbd5dd3a86810aadeec9f0 (diff) | |
| download | xserver-be6c17fcf9efebc0bbcc3d9a25f8c5a2450c2161.zip xserver-be6c17fcf9efebc0bbcc3d9a25f8c5a2450c2161.tar.gz xserver-be6c17fcf9efebc0bbcc3d9a25f8c5a2450c2161.tar.bz2 | |
CVE-2007-6429: Always test for size+offset wrapping.
| -rw-r--r-- | Xext/shm.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -799,10 +799,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); @@ -1144,10 +1144,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)( |
