diff options
author | unknown <davi@endora.local> | 2007-10-31 02:04:04 -0200 |
---|---|---|
committer | unknown <davi@endora.local> | 2007-10-31 02:04:04 -0200 |
commit | 41974cf107200d898b35824492e5f770dff3063a (patch) | |
tree | 0087792c89ae7a865c0b217158ee041ccbcf36ad /libmysql | |
parent | 8365a74e47afd6a9598f21b75f3360448b69fcf6 (diff) | |
parent | 157645f45e9c5e3905cfb23c66e13fa01b4ae152 (diff) | |
download | mariadb-git-41974cf107200d898b35824492e5f770dff3063a.tar.gz |
Merge endora.local:/Users/davi/mysql/mysql-5.0-runtime
into endora.local:/Users/davi/mysql/bugs/31669-5.1
sql/sql_table.cc:
Auto merged
libmysql/libmysql.c:
Manual merge
tests/mysql_client_test.c:
Manual merge
Diffstat (limited to 'libmysql')
-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 e2e42fe4a2d..2b907ddf804 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -701,7 +701,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; CHARSET_INFO *saved_cs= mysql->charset; @@ -723,7 +724,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]) @@ -743,7 +744,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; /* Add character set number. */ |