summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2011-05-04 10:35:04 +0000
committerAndrey Hristov <andrey@php.net>2011-05-04 10:35:04 +0000
commit2d5e51db05a1ee9e4447920580a0188ed7e0e5f9 (patch)
tree8c1ed9f287b37d8d6b21fb1bb4d44018377614ed
parentbb2ccc96d3d5f40ae492f609328080f0e9c30bb9 (diff)
downloadphp-git-2d5e51db05a1ee9e4447920580a0188ed7e0e5f9.tar.gz
fix valgrind warning
-rw-r--r--ext/mysqlnd/mysqlnd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c
index 658af75b73..61943aa5ff 100644
--- a/ext/mysqlnd/mysqlnd.c
+++ b/ext/mysqlnd/mysqlnd.c
@@ -506,12 +506,13 @@ mysqlnd_connect_run_authentication(
size_t plugin_data_len;
plugin_data_len = greet_packet->auth_plugin_data_len;
- plugin_data = mnd_emalloc(plugin_data_len);
+ plugin_data = mnd_emalloc(plugin_data_len + 1);
if (!plugin_data) {
ret = FAIL;
goto end;
}
memcpy(plugin_data, greet_packet->auth_plugin_data, plugin_data_len);
+ plugin_data[plugin_data_len] = '\0';
requested_protocol = mnd_pestrdup(greet_packet->auth_protocol? greet_packet->auth_protocol: "mysql_native_password", FALSE);
if (!requested_protocol) {