Client flags are now copied to each backend and used in their connections.

log_manager.cc: fixed string allocation where one byte was missing.
mysql_client.c: fixed string allocation where one byte was missing.
This commit is contained in:
VilhoRaatikka
2014-10-08 22:27:28 +03:00
parent 76e85dfb11
commit 29e53e150a
4 changed files with 17 additions and 12 deletions

View File

@ -520,7 +520,7 @@ static char* get_username_from_auth(
if (ptr == NULL)
{
if ((rval = (char *)malloc(MYSQL_USER_MAXLEN)) == NULL)
if ((rval = (char *)malloc(MYSQL_USER_MAXLEN+1)) == NULL)
{
goto retblock;
}
@ -529,7 +529,7 @@ static char* get_username_from_auth(
{
rval = ptr;
}
strncpy(rval, first_letter, MYSQL_USER_MAXLEN);
snprintf(rval, MYSQL_USER_MAXLEN+1, "%s", first_letter);
retblock: