1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-24856 : Server crashes when wsrep_provider_options set to NULL

Null pointer reference to wsrep_provider_options variable. Fixed
by adding condition and error handling.
This commit is contained in:
Jan Lindström
2021-02-13 10:28:10 +02:00
parent 542d769ea1
commit cb4434c44a
3 changed files with 34 additions and 7 deletions

View File

@ -0,0 +1,10 @@
connection node_2;
connection node_1;
call mtr.add_suppression("WSREP: Unknown parameter 'a'");
call mtr.add_suppression("WSREP: Set options returned 7");
SET GLOBAL wsrep_provider_options=NULL;
ERROR HY000: Incorrect arguments to SET
SET GLOBAL wsrep_provider_options='';
SET GLOBAL wsrep_provider_options=' ';
SET GLOBAL wsrep_provider_options='a=1';
ERROR HY000: Incorrect arguments to SET

View File

@ -0,0 +1,11 @@
--source include/galera_cluster.inc
call mtr.add_suppression("WSREP: Unknown parameter 'a'");
call mtr.add_suppression("WSREP: Set options returned 7");
--error ER_WRONG_ARGUMENTS
SET GLOBAL wsrep_provider_options=NULL;
SET GLOBAL wsrep_provider_options='';
SET GLOBAL wsrep_provider_options=' ';
--error ER_WRONG_ARGUMENTS
SET GLOBAL wsrep_provider_options='a=1';

View File

@ -457,15 +457,21 @@ bool wsrep_provider_options_check(sys_var *self, THD* thd, set_var* var)
bool wsrep_provider_options_update(sys_var *self, THD* thd, enum_var_type type)
{
if (wsrep_provider_options)
{
enum wsrep::provider::status ret=
Wsrep_server_state::instance().provider().options(wsrep_provider_options);
if (ret)
{
WSREP_ERROR("Set options returned %d", ret);
goto err;
}
return refresh_provider_options();
}
err:
refresh_provider_options();
return true;
}
return refresh_provider_options();
}
void wsrep_provider_options_init(const char* value)