Skip to content

Commit ea3ff73

Browse files
sciascidNirbhay Choubey
authored andcommitted
GCF-837 Fix crash when loading wrong provider version
mysqld would crash with "double free or corrruption message" if wrong provider version was given.
1 parent bf19492 commit ea3ff73

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sql/wsrep_mysqld.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,7 @@ int wsrep_init()
484484
WSREP_ERROR("wsrep_load(%s) failed: %s (%d). Reverting to no provider.",
485485
wsrep_provider, strerror(rcode), rcode);
486486
strcpy((char*)wsrep_provider, WSREP_NONE); // damn it's a dirty hack
487-
(void) wsrep_init();
488-
return rcode;
487+
return wsrep_init();
489488
}
490489
else /* this is for recursive call above */
491490
{
@@ -671,6 +670,9 @@ void wsrep_init_startup (bool first)
671670
wsrep_thr_lock_init(wsrep_thd_is_BF, wsrep_abort_thd,
672671
wsrep_debug, wsrep_convert_LOCK_to_trx, wsrep_on);
673672

673+
/* Skip replication start if dummy wsrep provider is loaded */
674+
if (!strcmp(wsrep_provider, WSREP_NONE)) return;
675+
674676
/* Skip replication start if no cluster address */
675677
if (!wsrep_cluster_address || strlen(wsrep_cluster_address) == 0) return;
676678

0 commit comments

Comments
 (0)