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

Vinson Lee vlee at kemper.freedesktop.org
Tue Dec 8 18:02:16 PST 2009


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

Author: Vinson Lee <vlee at vmware.com>
Date:   Tue Dec  8 17:51:07 2009 -0800

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

_mesa_Fogf calls _mesa_Fogfv, which uses the params argument
as an array.

---

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

diff --git a/src/mesa/main/fog.c b/src/mesa/main/fog.c
index 99eb141..269ff3f 100644
--- a/src/mesa/main/fog.c
+++ b/src/mesa/main/fog.c
@@ -34,7 +34,10 @@
 void GLAPIENTRY
 _mesa_Fogf(GLenum pname, GLfloat param)
 {
-   _mesa_Fogfv(pname, &param);
+   GLfloat fparam[4];
+   fparam[0] = param;
+   fparam[1] = fparam[2] = fparam[3] = 0.0F;
+   _mesa_Fogfv(pname, fparam);
 }
 
 



More information about the mesa-commit mailing list