Skip to content

Commit ed9df19

Browse files
committed
Fix for cleartext plugin: We need to send also terminating zero character for password
1 parent 85325bc commit ed9df19

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plugins/auth/mariadb_cleartext.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ static int clear_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
4747
if (!vio || !mysql || !mysql->passwd)
4848
return CR_ERROR;
4949

50-
return vio->write_packet(vio, (const unsigned char *) mysql->passwd, strlen(mysql->passwd)) ?
50+
/* write password including terminating zero character */
51+
return vio->write_packet(vio, (const unsigned char *) mysql->passwd, strlen(mysql->passwd) + 1) ?
5152
CR_ERROR : CR_OK;
5253
}
5354
/* }}} */

0 commit comments

Comments
 (0)