Skip to content

Commit

Permalink
Fix stack corruption caught by address sanitizer
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasf-unity committed Oct 28, 2018
1 parent 7dc9ce0 commit cf63afd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/DagGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,7 @@ static bool RunExternalTool(const char* options, ...)
const char* cmdline_to_use;

char option_str[1024];
char cmdline[1024];
va_list args;
va_start(args, options);
vsnprintf(option_str, sizeof option_str, options, args);
Expand All @@ -979,7 +980,6 @@ static bool RunExternalTool(const char* options, ...)
if (strchr(dag_gen_path, ' '))
quotes = "\"";

char cmdline[1024];
snprintf(cmdline, sizeof cmdline, "%s%s%s %s", quotes, dag_gen_path, quotes, option_str);
cmdline[sizeof(cmdline)-1] = '\0';

Expand Down

0 comments on commit cf63afd

Please sign in to comment.