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

Vinson Lee vlee at kemper.freedesktop.org
Tue Dec 8 18:38:44 PST 2009


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

Author: Vinson Lee <vlee at vmware.com>
Date:   Tue Dec  8 18:26:05 2009 -0800

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

_mesa_LightModeli calls _mesa_LightModeliv, 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 10c89f4..5a8f916 100644
--- a/src/mesa/main/light.c
+++ b/src/mesa/main/light.c
@@ -537,7 +537,10 @@ _mesa_LightModeliv( GLenum pname, const GLint *params )
 void GLAPIENTRY
 _mesa_LightModeli( GLenum pname, GLint param )
 {
-   _mesa_LightModeliv( pname, &param );
+   GLint iparam[4];
+   iparam[0] = param;
+   iparam[1] = iparam[2] = iparam[3] = 0;
+   _mesa_LightModeliv( pname, iparam );
 }
 
 



More information about the mesa-commit mailing list