summaryrefslogtreecommitdiff
path: root/tests/glslparsertest
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2015-08-30 16:42:33 +0200
committerMarek Olšák <marek.olsak@amd.com>2015-09-06 22:45:10 +0200
commit18bde5e6e2ee5f6d1c6138dc7ed18a466ff5b8c5 (patch)
tree72b23ae5008177b9ceb9c054fe21c41f17d542df /tests/glslparsertest
parent2f723b23a9b96b68c4dea3a26c2d5662a0965b1f (diff)
glslparsertest: fix buffer overflow
Diffstat (limited to 'tests/glslparsertest')
-rw-r--r--tests/glslparsertest/glslparsertest.c10
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);
}