mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Bug#20894 Reproducible MySQL client segmentation fault
- Add two null bytes in "buff" variable allowing us to call get_arg two times also for strings longer than sizeof(buff)
This commit is contained in:
@ -2934,7 +2934,11 @@ com_connect(String *buffer, char *line)
|
||||
bzero(buff, sizeof(buff));
|
||||
if (buffer)
|
||||
{
|
||||
strmake(buff, line, sizeof(buff) - 1);
|
||||
/*
|
||||
Two null bytes are needed in the end of buff to allow
|
||||
get_arg to find end of string the second time it's called.
|
||||
*/
|
||||
strmake(buff, line, sizeof(buff)-2);
|
||||
tmp= get_arg(buff, 0);
|
||||
if (tmp && *tmp)
|
||||
{
|
||||
|
Reference in New Issue
Block a user