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

Vinson Lee vlee at kemper.freedesktop.org
Wed Dec 9 18:06:20 PST 2009


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

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

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

_mesa_Lighti calls _mesa_Lightiv, which uses the params argument
as an array.

---

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

diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c
index d4f3bb9..5150926 100644
--- a/src/mesa/main/light.c
+++ b/src/mesa/main/light.c
@@ -288,7 +288,10 @@ _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params )
 void GLAPIENTRY
 _mesa_Lighti( GLenum light, GLenum pname, GLint param )
 {
-   _mesa_Lightiv( light, pname, &param );
+   GLint iparam[4];
+   iparam[0] = param;
+   iparam[1] = iparam[2] = iparam[3] = 0;
+   _mesa_Lightiv( light, pname, iparam );
 }
 
 



More information about the mesa-commit mailing list