projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f4952f0
)
progs/glsl: Prevent possible string overflow.
author
Vinson Lee
<vlee@vmware.com>
Wed, 6 Jan 2010 23:25:42 +0000
(15:25 -0800)
committer
Vinson Lee
<vlee@vmware.com>
Wed, 6 Jan 2010 23:25:42 +0000
(15:25 -0800)
progs/glsl/shtest.c
patch
|
blob
|
history
diff --git
a/progs/glsl/shtest.c
b/progs/glsl/shtest.c
index e9800c307f3f092b405fcd007493f3ef757b0911..7b1917be1ce6249071b88ac7a944930e3d9030ed 100644
(file)
--- a/
progs/glsl/shtest.c
+++ b/
progs/glsl/shtest.c
@@
-549,6
+549,10
@@
ReadConfigFile(const char *filename, struct config_file *conf)
type = TypeFromName(typeName);
+ if (strlen(name) + 1 > sizeof(conf->uniforms[conf->num_uniforms].name)) {
+ fprintf(stderr, "string overflow\n");
+ exit(1);
+ }
strcpy(conf->uniforms[conf->num_uniforms].name, name);
conf->uniforms[conf->num_uniforms].value[0] = v1;
conf->uniforms[conf->num_uniforms].value[1] = v2;