Mesa (dlist-statechange-shortcircuit): glx: fix null pointer dereference segfault (bug 22546)

Keith Whitwell keithw at kemper.freedesktop.org
Tue Jun 30 16:06:03 UTC 2009


Module: Mesa
Branch: dlist-statechange-shortcircuit
Commit: 52f895df518608321873f53d6f8549bdbaf0059a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=52f895df518608321873f53d6f8549bdbaf0059a

Author: Brian Paul <brianp at vmware.com>
Date:   Tue Jun 30 08:27:28 2009 -0600

glx: fix null pointer dereference segfault (bug 22546)

---

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

diff --git a/src/glx/x11/glxcmds.c b/src/glx/x11/glxcmds.c
index 77471b8..820d8b9 100644
--- a/src/glx/x11/glxcmds.c
+++ b/src/glx/x11/glxcmds.c
@@ -164,7 +164,7 @@ GetGLXScreenConfigs(Display *dpy, int scrn)
 {
     __GLXdisplayPrivate * const priv = __glXInitialize(dpy);
 
-    return (priv->screenConfigs != NULL) ? &priv->screenConfigs[scrn] : NULL;
+    return (priv && priv->screenConfigs != NULL) ? &priv->screenConfigs[scrn] : NULL;
 }
 
 




More information about the mesa-commit mailing list