Mesa (mesa_7_6_branch): glx: Prevent potential null pointer deference in driCreateContext.

Vinson Lee vlee at kemper.freedesktop.org
Sun Dec 6 00:56:43 PST 2009


Module: Mesa
Branch: mesa_7_6_branch
Commit: 76b3523d752968bc552d4350a39b9b9b1a023cf0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=76b3523d752968bc552d4350a39b9b9b1a023cf0

Author: Vinson Lee <vlee at vmware.com>
Date:   Mon Nov 23 01:30:32 2009 -0500

glx: Prevent potential null pointer deference in driCreateContext.
(cherry picked from commit 4b0b250aae6ae7d48cd24f9d91d05ab58086c4b2)

---

 src/glx/x11/drisw_glx.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/glx/x11/drisw_glx.c b/src/glx/x11/drisw_glx.c
index 15e1586..1866b2c 100644
--- a/src/glx/x11/drisw_glx.c
+++ b/src/glx/x11/drisw_glx.c
@@ -250,12 +250,14 @@ driCreateContext(__GLXscreenConfigs * psc,
 {
    __GLXDRIcontextPrivate *pcp, *pcp_shared;
    __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) mode;
-   const __DRIcoreExtension *core = psc->core;
+   const __DRIcoreExtension *core;
    __DRIcontext *shared = NULL;
 
    if (!psc || !psc->driScreen)
       return NULL;
 
+   core = psc->core;
+
    if (shareList) {
       pcp_shared = (__GLXDRIcontextPrivate *) shareList->driContext;
       shared = pcp_shared->driContext;



More information about the mesa-commit mailing list