diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2015-02-14 10:36:44 +0000 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2015-05-07 14:07:43 -0400 |
commit | bcec9f867d19e954a46c2654a79782bff6c65fce (patch) | |
tree | ceba4f0aa0e51dd92aabb504dc12de2d5147f798 /Xext | |
parent | d61ae18074e53c2cdfb13cc37693b526160d6ca7 (diff) |
shm: Fix use-after-free in ShmDestroyPixmap
We pass the pPixmap->drawable.id to the ShmDetachSegment function after
the pPixmap is freed. Fortunately, we don't use the value inside
ShmDetachSegment and can simply pass zero instead.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Diffstat (limited to 'Xext')
-rw-r--r-- | Xext/shm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Xext/shm.c b/Xext/shm.c index db9d47450..52d997425 100644 --- a/Xext/shm.c +++ b/Xext/shm.c @@ -260,7 +260,7 @@ ShmDestroyPixmap(PixmapPtr pPixmap) pScreen->DestroyPixmap = ShmDestroyPixmap; if (shmdesc) - ShmDetachSegment(shmdesc, pPixmap->drawable.id); + ShmDetachSegment(shmdesc, 0); return ret; } @@ -427,7 +427,7 @@ ProcShmAttach(ClientPtr client) /*ARGSUSED*/ static int ShmDetachSegment(void *value, /* must conform to DeleteType */ - XID shmseg) + XID unused) { ShmDescPtr shmdesc = (ShmDescPtr) value; ShmDescPtr *prev; |