From 0d8cf03809e34e4307602bcfc6572ed585d56008 Mon Sep 17 00:00:00 2001 From: Raphael Junqueira Date: Tue, 10 May 2005 13:15:12 +0000 Subject: [PATCH] Fix allocated buffer size to avoid buffer overflow. --- dlls/opengl32/wgl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index c3f7406044a..0f0a21d7799 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -769,7 +769,7 @@ const GLubyte * internal_glGetString(GLenum name) { return NULL; } else { size_t len = strlen(GL_Extensions); - internal_gl_extensions = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); + internal_gl_extensions = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len + 2); while (*GL_Extensions != 0x00) { const char* Start = GL_Extensions; @@ -785,7 +785,7 @@ const GLubyte * internal_glGetString(GLenum name) { /* test if supported API is disabled by config */ if (NULL == strstr(internal_gl_disabled_extensions, ThisExtn)) { strcat(internal_gl_extensions, " "); - strcat(internal_gl_extensions, ThisExtn); + strcat(internal_gl_extensions, ThisExtn); TRACE(" active\n"); } else { TRACE(" deactived (by config)\n");