diff options
author | Vinson Lee <[email protected]> | 2010-02-21 00:36:50 -0800 |
---|---|---|
committer | Vinson Lee <[email protected]> | 2010-02-21 00:36:50 -0800 |
commit | d1aafb33b5193db351ece5887edad1c908cbf36b (patch) | |
tree | 2443a2dc13788959e94b1daa5b16d423cf0da6a8 /src/glsl | |
parent | f56c9c2b198dc740fd1559157a160b8a9d0de7a5 (diff) |
glsl/cl: Prevent possible buffer overflow.
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/cl/sl_cl_parse.c | 3 |
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; } |