[PATCH] [glx] Fix use of uninitialized variable in __glXDRIscreenProbe()

Tomas Carnecky tom at dbservice.com
Tue Dec 22 02:48:24 PST 2009


This fixed a 'Result of operation is garbage or undefined' bug found
by clang. 'framebuffer.base' was read before being initialized.

Signed-off-by: Tomas Carnecky <tom at dbservice.com>
---
 glx/glxdri.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/glx/glxdri.c b/glx/glxdri.c
index 6122653..f20e50c 100644
--- a/glx/glxdri.c
+++ b/glx/glxdri.c
@@ -977,6 +977,8 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
 	return NULL;
     }
 
+    framebuffer.base = NULL;
+
     screen = xcalloc(1, sizeof *screen);
     if (screen == NULL)
       return NULL;
-- 
1.6.6.rc4




More information about the xorg-devel mailing list