diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2021-02-13 10:28:10 +0200 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2021-02-13 10:28:10 +0200 |
commit | cb4434c44aa045256543c0a027b04e2ecb9c717d (patch) | |
tree | 68969dbc1effdeeecc74f7ad16aee6e1c9eabab6 /sql/wsrep_var.cc | |
parent | 542d769ea1a22a7a6a87c9fe76ff911a162ade44 (diff) | |
download | mariadb-git-cb4434c44aa045256543c0a027b04e2ecb9c717d.tar.gz |
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.
Diffstat (limited to 'sql/wsrep_var.cc')
-rw-r--r-- | sql/wsrep_var.cc | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/sql/wsrep_var.cc b/sql/wsrep_var.cc index dea388d30de..df37a3b015c 100644 --- a/sql/wsrep_var.cc +++ b/sql/wsrep_var.cc @@ -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) { - enum wsrep::provider::status ret= - Wsrep_server_state::instance().provider().options(wsrep_provider_options); - if (ret) + if (wsrep_provider_options) { - WSREP_ERROR("Set options returned %d", ret); - refresh_provider_options(); - return true; + 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(); } - return refresh_provider_options(); +err: + refresh_provider_options(); + return true; } void wsrep_provider_options_init(const char* value) |