Commit 795699b2 authored by Wim Taymans's avatar Wim Taymans

parse: increase array size

Increase the size of the array to hold our variable name and use
snprintf to avoid overflows.
parent 4c81fbf1
......@@ -307,7 +307,7 @@ orc_parse_full (const char *code, OrcProgram ***programs, char **log)
char *end;
double unused ORC_GNUC_UNUSED;
char varname[20];
char varname[80];
args[j] = token[i];
......@@ -316,7 +316,7 @@ orc_parse_full (const char *code, OrcProgram ***programs, char **log)
int id;
/* make a unique name based on value and size */
sprintf (varname, "_%d.%s", opcode_arg_size(o, j), token[i]);
snprintf (varname, sizeof (varname), "_%d.%s", opcode_arg_size(o, j), token[i]);
id = orc_program_add_constant_str (parser->program, opcode_arg_size(o, j),
token[i], varname);
/* it's possible we reused an existing variable, get its name so
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment