From ae41339d4ce7c642c03a8d6f5310a68422261150 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 20 Feb 2010 23:27:07 -0800 Subject: glsl/cl: Prevent possible string overflow. --- src/glsl/cl/sl_cl_parse.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/glsl/cl') diff --git a/src/glsl/cl/sl_cl_parse.c b/src/glsl/cl/sl_cl_parse.c index 8106ff6f61..2291ec2200 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'; } } -- cgit v1.2.3