projects
/
profile
/
ivi
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dbaa845
)
glsl/cl: Prevent possible string overflow.
author
Vinson Lee
<vlee@vmware.com>
Sun, 21 Feb 2010 07:27:07 +0000
(23:27 -0800)
committer
Vinson Lee
<vlee@vmware.com>
Sun, 21 Feb 2010 07:27:07 +0000
(23:27 -0800)
src/glsl/cl/sl_cl_parse.c
patch
|
blob
|
history
diff --git
a/src/glsl/cl/sl_cl_parse.c
b/src/glsl/cl/sl_cl_parse.c
index
8106ff6
..
2291ec2
100644
(file)
--- a/
src/glsl/cl/sl_cl_parse.c
+++ b/
src/glsl/cl/sl_cl_parse.c
@@
-387,7
+387,8
@@
_error(struct parse_context *ctx,
const char *msg)
{
if (ctx->error[0] == '\0') {
- strcpy(ctx->error, msg);
+ strncpy(ctx->error, msg, sizeof(ctx->error) - 1);
+ ctx->error[sizeof(ctx->error) - 1] = '\0';
}
}