Bug#16372927: STACK OVERFLOW WITH LONG DATABASE NAME IN

GRANT STATEMENT

Description: Merge from 5.1.
This commit is contained in:
Harin Vadodaria 2013-02-26 21:29:43 +05:30
commit ca2708c061

View file

@ -3999,7 +3999,8 @@ bool mysql_grant(THD *thd, const char *db, List <LEX_USER> &list,
if (lower_case_table_names && db) if (lower_case_table_names && db)
{ {
strmov(tmp_db,db); strnmov(tmp_db,db,NAME_LEN);
tmp_db[NAME_LEN]= '\0';
my_casedn_str(files_charset_info, tmp_db); my_casedn_str(files_charset_info, tmp_db);
db=tmp_db; db=tmp_db;
} }