Commit db56fd00 authored by Ramil Kalimullin's avatar Ramil Kalimullin

Fix for bug#37669: Server crash by setting "@@session.innodb_table_locks"

Problem: reading/writing data from/to an address without proper
alignment leads to SIGBUS on some platforms.

Fix: use the correct data type when dereferencing variable values.
parent 449d359f
...@@ -1882,7 +1882,7 @@ static int check_func_bool(THD *thd, struct st_mysql_sys_var *var, ...@@ -1882,7 +1882,7 @@ static int check_func_bool(THD *thd, struct st_mysql_sys_var *var,
} }
result= (int) tmp; result= (int) tmp;
} }
*(int*)save= -result; *(my_bool *) save= -result;
return 0; return 0;
err: err:
my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->name, strvalue); my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->name, strvalue);
...@@ -2063,7 +2063,7 @@ static int check_func_set(THD *thd, struct st_mysql_sys_var *var, ...@@ -2063,7 +2063,7 @@ static int check_func_set(THD *thd, struct st_mysql_sys_var *var,
static void update_func_bool(THD *thd, struct st_mysql_sys_var *var, static void update_func_bool(THD *thd, struct st_mysql_sys_var *var,
void *tgt, const void *save) void *tgt, const void *save)
{ {
*(my_bool *) tgt= *(int *) save ? 1 : 0; *(my_bool *) tgt= *(my_bool *) save ? TRUE : FALSE;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment