File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -451,7 +451,7 @@ static void* sst_joiner_thread (void* a)
451
451
} else {
452
452
// Scan state ID first followed by wsrep_gtid_domain_id.
453
453
char uuid[512 ];
454
- uint32 domain_id;
454
+ long int domain_id;
455
455
size_t len= pos - out + 1 ;
456
456
457
457
if (len > sizeof (uuid)) goto err; // safety check
@@ -464,14 +464,18 @@ static void* sst_joiner_thread (void* a)
464
464
}
465
465
else if (wsrep_gtid_mode)
466
466
{
467
+ errno= 0 ; /* Reset the errno */
467
468
domain_id= strtol (pos + 1 , NULL , 10 );
468
- if (domain_id < 1000 || domain_id > 0xFFFF )
469
+ err= errno;
470
+
471
+ /* Check if we received a valid gtid_domain_id. */
472
+ if (err == EINVAL || err == ERANGE || domain_id < 0x0 || domain_id > 0xFFFF )
469
473
{
470
474
WSREP_ERROR (" Failed to get donor wsrep_gtid_domain_id." );
471
475
err= EINVAL;
472
476
goto err;
473
477
} else {
474
- wsrep_gtid_domain_id= domain_id;
478
+ wsrep_gtid_domain_id= (uint32) domain_id;
475
479
}
476
480
}
477
481
}
You can’t perform that action at this time.
0 commit comments