diff options
| author | Sergey Glukhov <Sergey.Glukhov@sun.com> | 2009-04-23 12:43:42 +0500 |
|---|---|---|
| committer | Sergey Glukhov <Sergey.Glukhov@sun.com> | 2009-04-23 12:43:42 +0500 |
| commit | 3b3fc01425a89fd2c60890fb6019eb58dc121e03 (patch) | |
| tree | 298f925620b41190de3964ef5aeb3d4c2359c97c /sql/sql_crypt.cc | |
| parent | c27566aec5529beacd7ee27be4433827d8fa1755 (diff) | |
| download | mariadb-git-3b3fc01425a89fd2c60890fb6019eb58dc121e03.tar.gz | |
Bug#44358 valgrind errors with decode() function
The warning happens because string argument is not zero ended.
The fix is to add new parameter 'length' to SQL_CRYPT() and
use ptr() instead of c_ptr().
Diffstat (limited to 'sql/sql_crypt.cc')
| -rw-r--r-- | sql/sql_crypt.cc | 4 |
1 files changed, 2 insertions, 2 deletions
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); } |
