diff options
author | Marek Olšák <marek.olsak@amd.com> | 2015-08-30 16:42:33 +0200 |
---|---|---|
committer | Marek Olšák <marek.olsak@amd.com> | 2015-09-06 22:45:10 +0200 |
commit | 18bde5e6e2ee5f6d1c6138dc7ed18a466ff5b8c5 (patch) | |
tree | 72b23ae5008177b9ceb9c054fe21c41f17d542df /tests/glslparsertest | |
parent | 2f723b23a9b96b68c4dea3a26c2d5662a0965b1f (diff) |
glslparsertest: fix buffer overflow
Diffstat (limited to 'tests/glslparsertest')
-rw-r--r-- | tests/glslparsertest/glslparsertest.c | 10 |
1 files changed, 5 insertions, 5 deletions
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); } |