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 bb2ccc9 commit 2d5e51dCopy full SHA for 2d5e51d
ext/mysqlnd/mysqlnd.c
@@ -506,12 +506,13 @@ mysqlnd_connect_run_authentication(
506
size_t plugin_data_len;
507
508
plugin_data_len = greet_packet->auth_plugin_data_len;
509
- plugin_data = mnd_emalloc(plugin_data_len);
+ plugin_data = mnd_emalloc(plugin_data_len + 1);
510
if (!plugin_data) {
511
ret = FAIL;
512
goto end;
513
}
514
memcpy(plugin_data, greet_packet->auth_plugin_data, plugin_data_len);
515
+ plugin_data[plugin_data_len] = '\0';
516
517
requested_protocol = mnd_pestrdup(greet_packet->auth_protocol? greet_packet->auth_protocol: "mysql_native_password", FALSE);
518
if (!requested_protocol) {
0 commit comments