Mesa (mesa_7_6_branch): dri: Fix potential null pointer dereference in driBindContext.

Vinson Lee vlee at kemper.freedesktop.org
Sun Dec 6 01:02:20 PST 2009


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

Author: Vinson Lee <vlee at vmware.com>
Date:   Sat Nov 28 23:22:31 2009 -0500

dri: Fix potential null pointer dereference in driBindContext.
(cherry picked from commit 919898e92fa23ff71a59d86a46ff0886a6f34e4d)

---

 src/mesa/drivers/dri/common/dri_util.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index 439f66a..da81ec9 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -167,11 +167,12 @@ static int driBindContext(__DRIcontext *pcp,
 			  __DRIdrawable *pdp,
 			  __DRIdrawable *prp)
 {
-    __DRIscreenPrivate *psp = pcp->driScreenPriv;
+    __DRIscreenPrivate *psp;
 
     /* Bind the drawable to the context */
 
     if (pcp) {
+	psp = pcp->driScreenPriv;
 	pcp->driDrawablePriv = pdp;
 	pcp->driReadablePriv = prp;
 	if (pdp) {



More information about the mesa-commit mailing list