diff options
author | unknown <davi@moksha.com.br> | 2007-10-30 09:41:24 -0300 |
---|---|---|
committer | unknown <davi@moksha.com.br> | 2007-10-30 09:41:24 -0300 |
commit | 2c56c2b98694e67439a0771d31af711b5cab96c5 (patch) | |
tree | 6db8ace6517c55c9059a81f2085a12d2f2498a70 /libmysql/libmysql.c | |
parent | 609d2150a9a16279a7957082a94f4c6228793cbc (diff) | |
parent | 138ac2dea9a2748c0e2e8454e5fb604501e19424 (diff) | |
download | mariadb-git-2c56c2b98694e67439a0771d31af711b5cab96c5.tar.gz |
Merge moksha.local:/Users/davi/mysql/bugs/31669-5.0
into moksha.local:/Users/davi/mysql/mysql-5.0-runtime
libmysql/libmysql.c:
Auto merged
tests/mysql_client_test.c:
Auto merged
Diffstat (limited to 'libmysql/libmysql.c')
-rw-r--r-- | libmysql/libmysql.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index e50bd16ca32..85509b49fdd 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -706,7 +706,8 @@ int cli_read_change_user_result(MYSQL *mysql, char *buff, const char *passwd) my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user, const char *passwd, const char *db) { - char buff[512],*end=buff; + char buff[USERNAME_LENGTH+SCRAMBLED_PASSWORD_CHAR_LENGTH+NAME_LEN+2]; + char *end= buff; int rc; DBUG_ENTER("mysql_change_user"); @@ -716,7 +717,7 @@ my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user, passwd=""; /* Store user into the buffer */ - end=strmov(end,user)+1; + end= strmake(end, user, USERNAME_LENGTH) + 1; /* write scrambled password according to server capabilities */ if (passwd[0]) @@ -736,7 +737,7 @@ my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user, else *end++= '\0'; /* empty password */ /* Add database if needed */ - end= strmov(end, db ? db : "") + 1; + end= strmake(end, db ? db : "", NAME_LEN) + 1; /* Write authentication package */ simple_command(mysql,COM_CHANGE_USER, buff,(ulong) (end-buff),1); |