[Mesa-dev] [PATCH] st/mesa: Initialize variable.

Jakob Bornecrantz jakob at vmware.com
Thu Oct 20 17:02:08 PDT 2011


Looks good!

Reviewed-by: Jakob Bornecrantz <jakob at vmware.com>

----- Original Message -----
> ptr is uninitialized if ib in NULL.
> 
> Fixes Coverity uninitialized pointer read defect.
> ---
>  src/mesa/state_tracker/st_draw.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/src/mesa/state_tracker/st_draw.c
> b/src/mesa/state_tracker/st_draw.c
> index 20ba993..a2bff04 100644
> --- a/src/mesa/state_tracker/st_draw.c
> +++ b/src/mesa/state_tracker/st_draw.c
> @@ -657,6 +657,8 @@ handle_fallback_primitive_restart(struct
> pipe_context *pipe,
>        else {
>           ptr = ib->ptr;
>        }
> +   } else {
> +      ptr = NULL;
>     }
>  
>     if (!ptr)
> --
> 1.7.1
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 


More information about the mesa-dev mailing list