diff options
author | Vinson Lee <[email protected]> | 2010-02-20 23:27:07 -0800 |
---|---|---|
committer | Vinson Lee <[email protected]> | 2010-02-20 23:27:07 -0800 |
commit | ae41339d4ce7c642c03a8d6f5310a68422261150 (patch) | |
tree | 81960f1d3f3ad98e203a0863fb7d81333ff1c3f6 /src | |
parent | dbaa84515318c3cf1d4be67fc10ca3bd6bc00e0f (diff) |
glsl/cl: Prevent possible string overflow.
Diffstat (limited to 'src')
-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 8106ff6f619..2291ec22004 100644 --- 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'; } } |