Skip to content

Commit 62152f7

Browse files
author
Kristofer Pettersson
committed
WL5602 - remove misleading comment. Improve on code readability.
1 parent d110ce3 commit 62152f7

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

sql-common/client_authentication.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ int sha256_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
8989
DBUG_ENTER("sha256_password_auth_client");
9090

9191
/*
92-
Always get scramble from the server. This is done because the plugin
93-
framework won't work if a server side plugin starts with a read_packet()
92+
Get the scramble from the server because we need it when sending encrypted
93+
password.
9494
*/
9595
if (vio->read_packet(vio, &pkt) != SCRAMBLE_LENGTH)
9696
DBUG_RETURN(CR_ERROR);
@@ -110,7 +110,8 @@ int sha256_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
110110
if (!uses_password)
111111
{
112112
/* We're not using a password */
113-
if (vio->write_packet(vio, (const unsigned char *) &mysql->passwd[0], 1))
113+
static const unsigned char zero_byte= '\0';
114+
if (vio->write_packet(vio, (const unsigned char *) &zero_byte, 1))
114115
DBUG_RETURN(CR_ERROR);
115116
}
116117
else

0 commit comments

Comments
 (0)