Fix out-of-bounds writes on long maxadmin commands

If a maxadmin command had more than the maximum amount of arguments, the
buffer used to store the split arguments would overflow.
This commit is contained in:
Markus Mäkelä
2017-08-17 19:39:02 +03:00
parent fe580d272f
commit 521aff6c8f

View File

@ -1753,7 +1753,7 @@ execute_cmd(CLI_SESSION *cli)
{
DCB *dcb = cli->session->client_dcb;
int argc, i, j, found = 0;
char *args[MAXARGS + 1];
char *args[MAXARGS + 4];
int in_quotes = 0, escape_next = 0;
char *ptr, *lptr;
bool in_space = false;