mesa: Prevent possible out-of-bounds read by save_SamplerParameteriv.
authorVinson Lee <vlee@freedesktop.org>
Thu, 6 Jun 2013 06:01:00 +0000 (23:01 -0700)
committerVinson Lee <vlee@freedesktop.org>
Sat, 8 Jun 2013 20:32:53 +0000 (13:32 -0700)
Fixes "Out-of-bounds access" defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/main/dlist.c

index abc86657cf00605316e3c72f9e020a66d933fcab..8900c89ea2da9cdc8482b3bab57732de138c51cd 100644 (file)
@@ -7024,7 +7024,10 @@ save_SamplerParameteriv(GLuint sampler, GLenum pname, const GLint *params)
 static void GLAPIENTRY
 save_SamplerParameteri(GLuint sampler, GLenum pname, GLint param)
 {
-   save_SamplerParameteriv(sampler, pname, &param);
+   GLint parray[4];
+   parray[0] = param;
+   parray[1] = parray[2] = parray[3] = 0;
+   save_SamplerParameteriv(sampler, pname, param);
 }
 
 static void GLAPIENTRY