1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

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().


mysql-test/r/func_str.result:
  test result
mysql-test/t/func_str.test:
  test case
sql/item_strfunc.cc:
  Added new parameter 'length' to SQL_CRYPT
sql/sql_crypt.cc:
  Added new parameter 'length' to SQL_CRYPT
sql/sql_crypt.h:
  Added new parameter 'length' to SQL_CRYPT
This commit is contained in:
Sergey Glukhov
2009-04-23 12:43:42 +05:00
parent e0526914b6
commit 5f9e40a5f8
5 changed files with 31 additions and 5 deletions

View File

@ -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);
}