[Mesa-dev] [PATCH] mesa: In validate_program(), initialize errMsg for safety.
Chad Versace
chad at chad-versace.us
Fri Aug 5 14:09:50 PDT 2011
On 07/30/2011 09:34 PM, Kenneth Graunke wrote:
> validate_program relies on validate_shader_program to fill in errMsg;
> empirically, there exist cases where that doesn't happen.
>
> While tracking those down may be worthwhile, initializing the string so
> we don't try to ralloc_strdup random garbage also seems wise.
>
> Fixes issues caught by valgrind while running some test case.
>
> NOTE: This is a candidate for stable release branches.
>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
> src/mesa/main/shaderapi.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
> index 8df25c3..74997ea 100644
> --- a/src/mesa/main/shaderapi.c
> +++ b/src/mesa/main/shaderapi.c
> @@ -1125,7 +1125,7 @@ static void
> validate_program(struct gl_context *ctx, GLuint program)
> {
> struct gl_shader_program *shProg;
> - char errMsg[100];
> + char errMsg[100] = "";
>
> shProg = _mesa_lookup_shader_program_err(ctx, program, "glValidateProgram");
> if (!shProg) {
Reviewed-by: Chad Versace <chad at chad-versace.us>
--
Chad Versace
chad at chad-versace.us
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110805/71f49145/attachment.pgp>
More information about the mesa-dev
mailing list