From: Ashish Agarwal Date: May 18 2012 6:19pm Subject: bzr push into mysql-trunk branch (ashish.y.agarwal:3891 to 3892) List-Archive: http://lists.mysql.com/commits/143852 Message-Id: <201205181819.q4IIJ9xf009003@acsmt357.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3892 Ashish Agarwal 2012-05-18 wl2739: Auditing Password Security Implementing code review modified: sql/string_service.cc sql/string_service.h 3891 Ashish Agarwal 2012-05-18 wl2739: Auditing Password Security Implementing code review. modified: include/mysql/plugin_validate_password.h mysql-test/t/validate_password_plugin.test plugin/password_validation/validate_password.cc sql/string_service.cc sql/string_service.h === modified file 'sql/string_service.cc' --- a/sql/string_service.cc 2012-05-18 15:35:54 +0000 +++ b/sql/string_service.cc 2012-05-18 18:18:17 +0000 @@ -45,7 +45,7 @@ int mysql_string_convert_to_char_ptr(mys extern "C" void mysql_string_free(mysql_string_handle string_handle) { - my_free(string_handle); + my_free((String *) string_handle); } /* @@ -55,7 +55,7 @@ void mysql_string_free(mysql_string_hand extern "C" void mysql_string_iterator_free(mysql_string_iterator_handle iterator_handle) { - my_free(iterator_handle); + my_free((string_iterator *) iterator_handle); } /* This service function allocate mysql_string_iterator_handle and return it */ @@ -132,23 +132,26 @@ extern "C" mysql_string_handle mysql_string_to_lowercase(mysql_string_handle string_handle) { String *str= (String *) string_handle; - uint len= 0; + String *res; const CHARSET_INFO *cs= str->charset(); if (cs->casedn_multiply == 1) { + uint len; len= cs->cset->casedn(cs, (char*) str->ptr(), str->length(), (char*) str->ptr(), str->length()); str->length(len); + res= str; } else { - len= str->length() * cs->casedn_multiply; - String temp_str= String((char*) str->ptr(), len, cs); + uint len= str->length() * cs->casedn_multiply; + temp_str.alloc(len); + temp_str.set_charset(cs); len= cs->cset->casedn(cs, (char*) str->ptr(), str->length(), (char*) temp_str.ptr(), len); temp_str.length(len); - str= &temp_str; + res= &temp_str; } - return (str); + return (res); } === modified file 'sql/string_service.h' --- a/sql/string_service.h 2012-05-18 15:35:54 +0000 +++ b/sql/string_service.h 2012-05-18 18:18:17 +0000 @@ -13,11 +13,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef STRING_SERVICE_INCLUDED -#define STRING_SERVICE_INCLUDED +#ifndef MY_STRING_SERVICE_INCLUDED +#define MY_STRING_SERVICE_INCLUDED #include "sql_string.h" +String temp_str; + /* mysql_string_itrerator structure to provide service to plugins */ struct string_iterator { @@ -26,4 +28,4 @@ struct string_iterator int ctype; }; -#endif /* STRING_SERVICE_INCLUDED */ +#endif /* MY_STRING_SERVICE_INCLUDED */ No bundle (reason: useless for push emails).