diff --git a/server/modules/routing/binlogrouter/blr_file.c b/server/modules/routing/binlogrouter/blr_file.c index 2ab742a69..2ffba12e5 100644 --- a/server/modules/routing/binlogrouter/blr_file.c +++ b/server/modules/routing/binlogrouter/blr_file.c @@ -555,7 +555,9 @@ blr_file_create(ROUTER_INSTANCE *router, char *orig_file) { close(router->binlog_fd); spinlock_acquire(&router->binlog_lock); - strcpy(router->binlog_name, file); + int len = strlen(file); + memmove(router->binlog_name, file, len); + router->binlog_name[len] = '\0'; router->binlog_fd = fd; /* Initial position after the magic number */ router->current_pos = BINLOG_MAGIC_SIZE; diff --git a/server/modules/routing/binlogrouter/blr_master.c b/server/modules/routing/binlogrouter/blr_master.c index e3405986e..398367d70 100644 --- a/server/modules/routing/binlogrouter/blr_master.c +++ b/server/modules/routing/binlogrouter/blr_master.c @@ -340,6 +340,7 @@ static void blr_restart_master(ROUTER_INSTANCE *router) { dcb_close(router->client); + router->client = NULL; /* Now it is safe to unleash other threads on this router instance */ spinlock_acquire(&router->lock);