Mesa (mesa_7_6_branch): mesa: Fix array out-of-bounds access by _mesa_TexGend.

Vinson Lee vlee at kemper.freedesktop.org
Wed Dec 9 18:30:52 PST 2009


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

Author: Vinson Lee <vlee at vmware.com>
Date:   Wed Dec  9 17:59:23 2009 -0800

mesa: Fix array out-of-bounds access by _mesa_TexGend.

_mesa_TexGend calls _mesa_TexGenfv, which uses the params argument
as an array.

---

 src/mesa/main/texgen.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c
index d3ea7b9..f9d3821 100644
--- a/src/mesa/main/texgen.c
+++ b/src/mesa/main/texgen.c
@@ -181,8 +181,10 @@ _mesa_TexGeniv(GLenum coord, GLenum pname, const GLint *params )
 void GLAPIENTRY
 _mesa_TexGend(GLenum coord, GLenum pname, GLdouble param )
 {
-   GLfloat p = (GLfloat) param;
-   _mesa_TexGenfv( coord, pname, &p );
+   GLfloat p[4];
+   p[0] = (GLfloat) param;
+   p[1] = p[2] = p[3] = 0.0F;
+   _mesa_TexGenfv( coord, pname, p );
 }
 
 



More information about the mesa-commit mailing list