projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f56c9c2
)
glsl/cl: Prevent possible buffer overflow.
author
Vinson Lee
<vlee@vmware.com>
Sun, 21 Feb 2010 08:36:50 +0000
(
00:36
-0800)
committer
Vinson Lee
<vlee@vmware.com>
Sun, 21 Feb 2010 08:36:50 +0000
(
00:36
-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 2291ec220046a560f12acc2ad1d0f7aa3247ccd1..9a20509fc66759fe61d4c801457eb27717d90a31 100644
(file)
--- a/
src/glsl/cl/sl_cl_parse.c
+++ b/
src/glsl/cl/sl_cl_parse.c
@@
-2949,7
+2949,8
@@
sl_cl_compile(struct sl_pp_context *context,
ctx.tokens_read = 0;
ctx.tokens = malloc(ctx.tokens_cap * sizeof(struct sl_pp_token_info));
if (!ctx.tokens) {
- strncpy(error, "out of memory", cberror);
+ strncpy(error, "out of memory", cberror - 1);
+ error[cberror - 1] = '\0';
return -1;
}