summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-10-22 11:58:54 +0200
committerSergei Golubchik <serg@mariadb.org>2015-10-22 11:58:54 +0200
commit956e92d90873532fee95581c702f7b76643969ea (patch)
treefaf0e7021947d6b333be6b05faa7c5a5448230dd /sql/sql_yacc.yy
parent27328ca1f43e252ed32712210cac1a83d5a0c96d (diff)
downloadmariadb-git-956e92d90873532fee95581c702f7b76643969ea.tar.gz
MDEV-8609 Server crashes in is_invalid_role_name on reloading ACL with a blank role name
strip endspaces from the role name in the parser because they'll be lost anyway when the name is stored in the mysql.user.user column (of type CHAR)
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r--sql/sql_yacc.yy6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index bb8215aaaec..4225f7317b8 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -15170,6 +15170,9 @@ current_role:
grant_role:
ident_or_text
{
+ CHARSET_INFO *cs= system_charset_info;
+ /* trim end spaces (as they'll be lost in mysql.user anyway) */
+ $1.length= cs->cset->lengthsp(cs, $1.str, $1.length);
if ($1.length == 0)
{
my_error(ER_INVALID_ROLE, MYF(0), "");
@@ -15184,8 +15187,7 @@ grant_role:
$$->auth= empty_lex_str;
if (check_string_char_length(&$$->user, ER(ER_USERNAME),
- username_char_length,
- system_charset_info, 0))
+ username_char_length, cs, 0))
MYSQL_YYABORT;
}
| current_role