We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a59d1c5 commit 0e9f5c5Copy full SHA for 0e9f5c5
ext/mysqlnd/mysqlnd_auth.c
@@ -912,9 +912,12 @@ mysqlnd_sha256_auth_get_auth_data(struct st_mysqlnd_authentication_plugin * self
912
if (conn->vio->data->ssl) {
913
DBG_INF("simple clear text under SSL");
914
/* clear text under SSL */
915
- *auth_data_len = passwd_len;
916
- ret = malloc(passwd_len);
+ /* NUL termination byte required: https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_connection_phase_authentication_methods_clear_text_password.html
+ * (this is similar to bug #78680, but now as GH-11440) */
917
+ *auth_data_len = passwd_len + 1;
918
+ ret = malloc(passwd_len + 1);
919
memcpy(ret, passwd, passwd_len);
920
+ ret[passwd_len] = '\0';
921
} else {
922
*auth_data_len = 0;
923
server_public_key = mysqlnd_sha256_get_rsa_key(conn, session_options, pfc_data);
0 commit comments