1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-24193 UBSAN: sql/sql_acl.cc:9985:29: runtime error: member access within null pointer of type 'struct TABLE' , ASAN: use-after-poison in handle_grant_table

privilege tables do not always have to exist
This commit is contained in:
Sergei Golubchik
2024-09-24 19:08:24 +02:00
parent 2cdcfb644c
commit 5bf543fd43
3 changed files with 25 additions and 1 deletions

View File

@ -10192,6 +10192,10 @@ static int handle_grant_table(THD *thd, const Grant_table_base& grant_table,
int result= 0;
int error;
TABLE *table= grant_table.table();
DBUG_ENTER("handle_grant_table");
if (!table)
DBUG_RETURN(0);
Field *host_field= table->field[0];
Field *user_field= table->field[which_table == USER_TABLE ||
which_table == PROXIES_PRIV_TABLE ? 1 : 2];
@ -10201,7 +10205,6 @@ static int handle_grant_table(THD *thd, const Grant_table_base& grant_table,
const char *user;
uchar user_key[MAX_KEY_LENGTH];
uint key_prefix_length;
DBUG_ENTER("handle_grant_table");
if (which_table == ROLES_MAPPING_TABLE)
{