glsl/cl: Prevent possible buffer overflow.
This commit is contained in:
parent
f56c9c2b19
commit
d1aafb33b5
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue