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

Vinson Lee vlee at kemper.freedesktop.org
Sat Dec 5 13:01:11 PST 2009


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

Author: Vinson Lee <vlee at vmware.com>
Date:   Sun Nov 29 00:50:48 2009 -0500

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

_mesa_TexGenf calls _mesa_TexGenfv, which uses the params argument
as an array.
(cherry picked from commit ca5a7aadb4361e7d053aea8687372cd44cbd8795)

---

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

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



More information about the mesa-commit mailing list