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

Vinson Lee vlee at kemper.freedesktop.org
Wed Dec 9 12:45:13 PST 2009


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

Author: Vinson Lee <vlee at vmware.com>
Date:   Wed Dec  9 12:43:28 2009 -0800

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

_mesa_LightModelf calls _mesa_LightModelfv, 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 5a8f916..c1d47de 100644
--- a/src/mesa/main/light.c
+++ b/src/mesa/main/light.c
@@ -547,7 +547,10 @@ _mesa_LightModeli( GLenum pname, GLint param )
 void GLAPIENTRY
 _mesa_LightModelf( GLenum pname, GLfloat param )
 {
-   _mesa_LightModelfv( pname, &param );
+   GLfloat fparam[4];
+   fparam[0] = param;
+   fparam[1] = fparam[2] = fparam[3] = 0.0F;
+   _mesa_LightModelfv( pname, fparam );
 }
 
 



More information about the mesa-commit mailing list