mesa: Fix potential out-of-bounds access by _vbo_Materialf.
authorVinson Lee <vlee@vmware.com>
Thu, 15 Jul 2010 07:53:07 +0000 (00:53 -0700)
committerVinson Lee <vlee@vmware.com>
Thu, 15 Jul 2010 07:53:07 +0000 (00:53 -0700)
_vbo_Materialf calls _vbo_Materialfv, which uses the params argument as
an array.

src/mesa/vbo/vbo_exec_api.c

index 365419d44fad7730567a42c29b3bc160cb844047..9df75a840657db6d23d30ddd6be0841613c50c10 100644 (file)
@@ -969,7 +969,10 @@ _vbo_Materialfv(GLenum face, GLenum pname, const GLfloat *params)
 void GLAPIENTRY
 _vbo_Materialf(GLenum face, GLenum pname, GLfloat param)
 {
-   vbo_Materialfv(face, pname, &param);
+   GLfloat p[4];
+   p[0] = param;
+   p[1] = p[2] = p[3] = 0.0F;
+   vbo_Materialfv(face, pname, p);
 }