From 18bde5e6e2ee5f6d1c6138dc7ed18a466ff5b8c5 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 30 Aug 2015 16:42:33 +0200 Subject: glslparsertest: fix buffer overflow --- tests/glslparsertest/glslparsertest.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/glslparsertest') diff --git a/tests/glslparsertest/glslparsertest.c b/tests/glslparsertest/glslparsertest.c index 924d3220a..e9a2cb3e7 100644 --- a/tests/glslparsertest/glslparsertest.c +++ b/tests/glslparsertest/glslparsertest.c @@ -152,7 +152,7 @@ static void attach_dummy_shader(GLuint shader_prog, GLenum type) { const char *shader_template; - char shader_text[128]; + char shader_text[4096]; GLint shader; switch (type) { @@ -180,10 +180,10 @@ attach_dummy_shader(GLuint shader_prog, GLenum type) break; } - sprintf(shader_text, - shader_template, - requested_version, - (requested_version == 300) ? "es" : ""); + snprintf(shader_text, sizeof(shader_text), + shader_template, + requested_version, + (requested_version == 300) ? "es" : ""); shader = piglit_compile_shader_text(type, shader_text); glAttachShader(shader_prog, shader); } -- cgit v1.2.3