summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVinson Lee <[email protected]>2010-02-21 00:36:50 -0800
committerVinson Lee <[email protected]>2010-02-21 00:36:50 -0800
commitd1aafb33b5193db351ece5887edad1c908cbf36b (patch)
tree2443a2dc13788959e94b1daa5b16d423cf0da6a8 /src
parentf56c9c2b198dc740fd1559157a160b8a9d0de7a5 (diff)
glsl/cl: Prevent possible buffer overflow.
Diffstat (limited to 'src')
-rw-r--r--src/glsl/cl/sl_cl_parse.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/glsl/cl/sl_cl_parse.c b/src/glsl/cl/sl_cl_parse.c
index 2291ec22004..9a20509fc66 100644
--- 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;
}