summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2019-03-30 12:52:23 +0100
committerSergei Golubchik <serg@mariadb.org>2019-04-02 18:22:37 +0200
commit65d758aa891bdafca6c881d3e7075979de3395e9 (patch)
tree395743d2c4ca5bfccce0a6a13dfb28cbb4a05197 /sql/sql_acl.cc
parent409f69cd7429655567024d0876895184d282cadb (diff)
downloadmariadb-git-65d758aa891bdafca6c881d3e7075979de3395e9.tar.gz
MDEV-18298 Crashes server with segfault during role grants
it was supposed to be `*(p-1)` not `*p-1` (the crash happens if `*p==0`)
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index ff18c1d4c10..c2e5bfd8c11 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -5311,7 +5311,7 @@ static bool merge_role_db_privileges(ACL_ROLE *grantee, const char *dbname,
ulong UNINIT_VAR(access), update_flags= 0;
for (int *p= dbs.front(); p <= dbs.back(); p++)
{
- if (first<0 || (!dbname && strcmp(acl_dbs.at(*p).db, acl_dbs.at(*p-1).db)))
+ if (first<0 || (!dbname && strcmp(acl_dbs.at(p[0]).db, acl_dbs.at(p[-1]).db)))
{ // new db name series
update_flags|= update_role_db(merged, first, access, grantee->user.str);
merged= -1;