diff options
author | kostja@dipika.(none) <> | 2008-02-08 18:55:07 +0300 |
---|---|---|
committer | kostja@dipika.(none) <> | 2008-02-08 18:55:07 +0300 |
commit | e9c887cc3db3d5df5ea88e626a555b1320e6d8e1 (patch) | |
tree | 3a57c4b096fb93cacd1a7a226b7cf5ffc4d1c8fc /sql-common | |
parent | ccd53222d61d25ae2702d87a3b617a1f835eedc7 (diff) | |
parent | d956281e1ea1d91d527c378686a49d176359e1a4 (diff) | |
download | mariadb-git-e9c887cc3db3d5df5ea88e626a555b1320e6d8e1.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into dipika.(none):/opt/local/work/mysql-5.1-runtime
Diffstat (limited to 'sql-common')
-rw-r--r-- | sql-common/my_user.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sql-common/my_user.c b/sql-common/my_user.c index 16a544387ee..d6f2818ad77 100644 --- a/sql-common/my_user.c +++ b/sql-common/my_user.c @@ -15,7 +15,7 @@ #include <my_user.h> #include <m_string.h> - +#include <mysql_com.h> /* Parse user value to user name and host name parts. @@ -47,6 +47,12 @@ void parse_user(const char *user_id_str, size_t user_id_len, *user_name_len= p - user_id_str; *host_name_len= user_id_len - *user_name_len - 1; + if (*user_name_len > USERNAME_LENGTH) + *user_name_len= USERNAME_LENGTH; + + if (*host_name_len > HOSTNAME_LENGTH) + *host_name_len= HOSTNAME_LENGTH; + memcpy(user_name_str, user_id_str, *user_name_len); memcpy(host_name_str, p + 1, *host_name_len); } |