Mesa (mesa_7_6_branch): mesa: Fix array out-of-bounds access by _mesa_Fogi.
Vinson Lee
vlee at kemper.freedesktop.org
Wed Dec 9 00:14:25 UTC 2009
Module: Mesa
Branch: mesa_7_6_branch
Commit: 7f146b38240e1c4efa6d8d0a4e5a0c8346706de5
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7f146b38240e1c4efa6d8d0a4e5a0c8346706de5
Author: Vinson Lee <vlee at vmware.com>
Date: Tue Dec 8 16:04:33 2009 -0800
mesa: Fix array out-of-bounds access by _mesa_Fogi.
_mesa_Fogi calls _mesa_Fogfv, which uses the params argument
as an array.
---
src/mesa/main/fog.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/mesa/main/fog.c b/src/mesa/main/fog.c
index 4323d3d..99eb141 100644
--- a/src/mesa/main/fog.c
+++ b/src/mesa/main/fog.c
@@ -41,8 +41,10 @@ _mesa_Fogf(GLenum pname, GLfloat param)
void GLAPIENTRY
_mesa_Fogi(GLenum pname, GLint param )
{
- GLfloat fparam = (GLfloat) param;
- _mesa_Fogfv(pname, &fparam);
+ GLfloat fparam[4];
+ fparam[0] = (GLfloat) param;
+ fparam[1] = fparam[2] = fparam[3] = 0.0F;
+ _mesa_Fogfv(pname, fparam);
}
More information about the mesa-commit
mailing list