Module: Mesa
Branch: master
Commit: 7bafd88c153e395274b632e7eae4bc9fc3aec1d2
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7bafd88c153e395274b632e7eae4bc9fc3aec1d2

Author: Vinson Lee <v...@freedesktop.org>
Date:   Sun Jun  2 23:16:42 2013 -0700

mesa: Prevent possible out-of-bounds read by save_SamplerParameterfv.

Fixes "Out-of-bounds access" defect reported by Coverity.

Signed-off-by: Vinson Lee <v...@freedesktop.org>
Reviewed-by: Brian Paul <bri...@vmware.com>

---

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

diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index c37b15e..18e3eb7 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -7056,7 +7056,10 @@ save_SamplerParameterfv(GLuint sampler, GLenum pname, 
const GLfloat *params)
 static void GLAPIENTRY
 save_SamplerParameterf(GLuint sampler, GLenum pname, GLfloat param)
 {
-   save_SamplerParameterfv(sampler, pname, &param);
+   GLfloat parray[4];
+   parray[0] = param;
+   parray[1] = parray[2] = parray[3] = 0.0F;
+   save_SamplerParameterfv(sampler, pname, parray);
 }
 
 static void GLAPIENTRY

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to