diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item_strfunc.cc | 4 | ||||
-rw-r--r-- | sql/sql_crypt.cc | 4 | ||||
-rw-r--r-- | sql/sql_crypt.h | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 5a8b1c6493c..5bb561fc1a9 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1742,7 +1742,7 @@ String *Item_func_encode::val_str(String *str) null_value=0; res=copy_if_not_alloced(str,res,res->length()); - SQL_CRYPT sql_crypt(password->ptr()); + SQL_CRYPT sql_crypt(password->ptr(), password->length()); sql_crypt.init(); sql_crypt.encode((char*) res->ptr(),res->length()); res->set_charset(&my_charset_bin); @@ -1771,7 +1771,7 @@ String *Item_func_decode::val_str(String *str) null_value=0; res=copy_if_not_alloced(str,res,res->length()); - SQL_CRYPT sql_crypt(password->ptr()); + SQL_CRYPT sql_crypt(password->ptr(), password->length()); sql_crypt.init(); sql_crypt.decode((char*) res->ptr(),res->length()); return res; diff --git a/sql/sql_crypt.cc b/sql/sql_crypt.cc index aa21d429d90..c4f93cc2a33 100644 --- a/sql/sql_crypt.cc +++ b/sql/sql_crypt.cc @@ -28,10 +28,10 @@ #include "mysql_priv.h" -SQL_CRYPT::SQL_CRYPT(const char *password) +SQL_CRYPT::SQL_CRYPT(const char *password, uint length) { ulong rand_nr[2]; - hash_password(rand_nr,password, (uint) strlen(password)); + hash_password(rand_nr,password, length); crypt_init(rand_nr); } diff --git a/sql/sql_crypt.h b/sql/sql_crypt.h index f3db9adde25..a5a6bee8a58 100644 --- a/sql/sql_crypt.h +++ b/sql/sql_crypt.h @@ -25,7 +25,7 @@ class SQL_CRYPT :public Sql_alloc uint shift; void crypt_init(ulong *seed); public: - SQL_CRYPT(const char *seed); + SQL_CRYPT(const char *seed, uint length); SQL_CRYPT(ulong *seed) { crypt_init(seed); |