mesa: avoid segfault in GetProgramPipelineInfoLog when no length
authorIlia Mirkin <imirkin@alum.mit.edu>
Fri, 12 Feb 2016 19:23:30 +0000 (14:23 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Fri, 12 Feb 2016 23:22:50 +0000 (18:22 -0500)
If there is no pipe info log, we would unconditionally deref length,
which was only optionally there. _mesa_copy_string handles the source
being null, as well as the length, so may as well just always call it.

Fixes a segfault in

dEQP-GLES31.functional.state_query.program_pipeline.info_log

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/main/pipelineobj.c

index 0e4a0af0b0f804ac27f4f4734f4c2fe076bcc0fa..af17be2a3f46db375e1360feacd3c978ec9cf845 100644 (file)
@@ -964,8 +964,5 @@ _mesa_GetProgramPipelineInfoLog(GLuint pipeline, GLsizei bufSize,
       return;
    }
 
-   if (pipe->InfoLog)
-      _mesa_copy_string(infoLog, bufSize, length, pipe->InfoLog);
-   else
-      *length = 0;
+   _mesa_copy_string(infoLog, bufSize, length, pipe->InfoLog);
 }