Hello,

there's another place where the returned pointer is not checked in
src/glx/dri2.c (see attachment). This might fix bug 29148.

Kind
regards

Ole

On Wednesday 28 July 2010 09:46:42 Niels Ole Salscheider
wrote:
> Hello,
> 
> I have written a small patch that fixes a crash in KWin
(see
> attachment).
> 
> Since dri2GetGlxDrawableFromXDrawableId may return
NULL we
> should only dereference the returned pointer if it is not NULL.
>

> Kind
> regards
> 
> Ole

From fe7b4347c14525abdf1b150400df3e209d1d91ad Mon Sep 17 00:00:00 2001
From: Niels Ole Salscheider <niels_...@salscheider-online.de>
Date: Wed, 28 Jul 2010 10:29:14 +0200
Subject: [PATCH] dri2GetGlxDrawableFromXDrawableId may return NULL

---
 src/glx/dri2.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/glx/dri2.c b/src/glx/dri2.c
index d53431c..771bf6c 100644
--- a/src/glx/dri2.c
+++ b/src/glx/dri2.c
@@ -103,6 +103,8 @@ DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire)
 
       /* Ignore swap events if we're not looking for them */
       pdraw = dri2GetGlxDrawableFromXDrawableId(dpy, awire->drawable);
+      if (pdraw == NULL)
+         return False;
       if (!(pdraw->eventMask & GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK))
 	 return False;
 
-- 
1.7.2

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to