[Mesa-dev] [PATCH] mesa: Prevent possible out-of-bounds read by save_SamplerParameterfv.

Brian Paul brian.e.paul at gmail.com
Mon Jun 3 08:37:44 PDT 2013


On Mon, Jun 3, 2013 at 12:24 AM, Vinson Lee <vlee at freedesktop.org> wrote:

> Fixes "Out-of-bounds access" defect reported by Coverity.
>
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
>  src/mesa/main/dlist.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
> index c37b15e..6c26313 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
>
>
> Reviewed-by: Brian Paul <brianp at vmware.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130603/05741853/attachment.html>


More information about the mesa-dev mailing list