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

Vinson Lee vlee at freedesktop.org
Thu May 30 23:59:28 PDT 2013


Fixes "Uninitialized pointer read" defect reported by Coverity.

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



More information about the mesa-dev mailing list