Fix reading of past-the-end memory
The buffer that binlogrouter allocated for the error message was too small. ASAN happened to catch this.
This commit is contained in:
@ -222,17 +222,12 @@ static void blr_start_master(void* data)
|
|||||||
router->retry_count++;
|
router->retry_count++;
|
||||||
spinlock_release(&router->lock);
|
spinlock_release(&router->lock);
|
||||||
/* Set reconnection task */
|
/* Set reconnection task */
|
||||||
static const char master[] = "Master";
|
std::string name = router->service->name;
|
||||||
char *name = (char *)MXS_MALLOC(strlen(router->service->name) + sizeof(master));
|
name += " Master";
|
||||||
if (name)
|
hktask_add(name.c_str(),
|
||||||
{
|
blr_start_master_in_main,
|
||||||
sprintf(name, "%s %s", router->service->name, master);
|
router,
|
||||||
hktask_add(name,
|
connect_retry);
|
||||||
blr_start_master_in_main,
|
|
||||||
router,
|
|
||||||
connect_retry);
|
|
||||||
MXS_FREE(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
MXS_ERROR("%s: failure while connecting to master server '%s', "
|
MXS_ERROR("%s: failure while connecting to master server '%s', "
|
||||||
"retrying in %d seconds",
|
"retrying in %d seconds",
|
||||||
|
|||||||
Reference in New Issue
Block a user