From f38ce8aba37d2976a9f67ba6fac0dd2bb8a2ce69 Mon Sep 17 00:00:00 2001 From: myT Date: Sat, 28 Oct 2017 22:48:00 +0200 Subject: [PATCH] fixed a buffer overflow in GL2_CreateShader --- code/renderer/tr_gl2.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/renderer/tr_gl2.cpp b/code/renderer/tr_gl2.cpp index f98b27b..c6cef61 100644 --- a/code/renderer/tr_gl2.cpp +++ b/code/renderer/tr_gl2.cpp @@ -312,8 +312,8 @@ static qbool GL2_CreateShader( GLuint* shaderPtr, GLenum shaderType, const char* GLint logLength = 0; qglGetShaderiv( shader, GL_INFO_LOG_LENGTH, &logLength ); - static char log[1024]; - qglGetShaderInfoLog( shader, logLength, NULL, log ); + static char log[4096]; // I've seen logs over 3 KB in size. + qglGetShaderInfoLog( shader, sizeof(log), NULL, log ); Com_Printf( "ERROR: %s shader: %s", shaderType == GL_VERTEX_SHADER ? "vertex" : "fragment", log ); return qfalse;