Fix debug argument concatenation

The buffer was shorter than the arguments given to it which caused a heap
buffer overflow.
This commit is contained in:
Markus Mäkelä
2020-10-23 10:53:26 +03:00
parent 48ef9754df
commit aa5a63be14

View File

@ -3322,7 +3322,7 @@ static bool handle_debug_args(char* args)
size_t total_len = 1;
for (int i = 0; debug_arguments[i].action != NULL; i++)
{
total_len += strlen(debug_arguments[i].name) + 1;
total_len += strlen(debug_arguments[i].name) + 2;
}
char arglist[total_len];
arglist[0] = '\0';