[Mesa-dev] [PATCH] ilo: Ensure array 'shaders' in fully initialized.

Chia-I Wu olvaffe at gmail.com
Fri May 31 00:35:27 PDT 2013


On Fri, May 31, 2013 at 2:59 PM, Vinson Lee <vlee at freedesktop.org> wrote:
> Fixes "Uninitialized pointer read" defect reported by Coverity.
This looks like a false alarm, as shaders are not read when
num_shaders is zero.  Does the report give more details?

> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
>  src/gallium/drivers/ilo/ilo_state.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/gallium/drivers/ilo/ilo_state.c b/src/gallium/drivers/ilo/ilo_state.c
> index 33da429..f071292 100644
> --- a/src/gallium/drivers/ilo/ilo_state.c
> +++ b/src/gallium/drivers/ilo/ilo_state.c
> @@ -83,7 +83,7 @@ finalize_shader_states(struct ilo_context *ilo)
>           .deps = 0,
>        },
>     };
> -   struct ilo_shader *shaders[PIPE_SHADER_TYPES];
> +   struct ilo_shader *shaders[PIPE_SHADER_TYPES] = { 0 };
>     int num_shaders = 0, i;
>
>     for (i = 0; i < PIPE_SHADER_TYPES; i++) {
> --
> 1.8.2.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev



--
olv at LunarG.com


More information about the mesa-dev mailing list