Skip to content

Commit

Permalink
Bug#26571995 SET DEFAULT ROLE ALL don't set mandatory roles.
Browse files Browse the repository at this point in the history
Post-push fix for UBSAN warning:
runtime error:
null pointer passed as argument 1, which is declared to never be null
sql/auth/sql_authorization.cc:7525

To repeat: ./mtr --mem --sanitize json_table

(cherry picked from commit 01fee7c1eb7aa2d516dab2e2d3e678056ad6ee5e)
  • Loading branch information
Tor Didriksen committed Oct 5, 2017
1 parent 29b9a7d commit d620927
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sql/auth/sql_authorization.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7522,5 +7522,8 @@ bool operator==(std::pair<const Role_id, std::pair<std::string, bool> > &a,

bool operator==(const LEX_CSTRING &a, const LEX_CSTRING &b)
{
return (a.length == b.length && memcmp(a.str, b.str, a.length) == 0);
return
(a.length == b.length &&
( (a.length == 0) ||
(memcmp(a.str, b.str, a.length) == 0)) );
}

0 comments on commit d620927

Please sign in to comment.