glsl/cl: Prevent possible string overflow.
This commit is contained in:
@@ -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';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user