From 5f9e40a5f8a469d87fb41002c18f3a41e9c4d6b3 Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Thu, 23 Apr 2009 12:43:42 +0500 Subject: 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 --- sql/sql_crypt.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/sql_crypt.h') 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); -- cgit v1.2.1