From ccd0c39cf4038cb08b18947fa5530da488abd6e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicen=C8=9Biu=20Ciorbaru?= Date: Fri, 18 Oct 2013 05:13:22 -0700 Subject: [PATCH] Fixed crash caused by dereferencing null pointer. The comparison is no longer necessary there. --- sql/sql_acl.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 091c55ae162..8d8672dbc3e 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -5469,12 +5469,11 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables, if (!(~tl->grant.privilege & want_access)) continue; - if (want_access & ~((grant_table ? grant_table->cols : 0) | + if ((want_access&= ~((grant_table ? grant_table->cols : 0) | (grant_table_role ? grant_table_role->cols : 0) | - tl->grant.privilege)) + tl->grant.privilege))) { - want_access &= ~(grant_table->cols | tl->grant.privilege); - goto err; // impossible + goto err; // impossible } } if (locked)