Commit 5683c113 authored by Markus Mäkelä's avatar Markus Mäkelä Committed by Robert Bindar

Use get_ident_len in heartbeat event error messages

The string doesn't appear to be null-terminated when binlog checksums are
enabled. This causes a corrupt binlog name in the error message when a
slave is ahead of the master.
parent 3c94c5b8
...@@ -4444,7 +4444,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) ...@@ -4444,7 +4444,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len)
error= ER_SLAVE_HEARTBEAT_FAILURE; error= ER_SLAVE_HEARTBEAT_FAILURE;
error_msg.append(STRING_WITH_LEN("inconsistent heartbeat event content;")); error_msg.append(STRING_WITH_LEN("inconsistent heartbeat event content;"));
error_msg.append(STRING_WITH_LEN("the event's data: log_file_name ")); error_msg.append(STRING_WITH_LEN("the event's data: log_file_name "));
error_msg.append(hb.get_log_ident(), (uint) strlen(hb.get_log_ident())); error_msg.append(hb.get_log_ident(), (uint) hb.get_ident_len());
error_msg.append(STRING_WITH_LEN(" log_pos ")); error_msg.append(STRING_WITH_LEN(" log_pos "));
llstr(hb.log_pos, llbuf); llstr(hb.log_pos, llbuf);
error_msg.append(llbuf, strlen(llbuf)); error_msg.append(llbuf, strlen(llbuf));
...@@ -4471,7 +4471,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) ...@@ -4471,7 +4471,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len)
error= ER_SLAVE_HEARTBEAT_FAILURE; error= ER_SLAVE_HEARTBEAT_FAILURE;
error_msg.append(STRING_WITH_LEN("heartbeat is not compatible with local info;")); error_msg.append(STRING_WITH_LEN("heartbeat is not compatible with local info;"));
error_msg.append(STRING_WITH_LEN("the event's data: log_file_name ")); error_msg.append(STRING_WITH_LEN("the event's data: log_file_name "));
error_msg.append(hb.get_log_ident(), (uint) strlen(hb.get_log_ident())); error_msg.append(hb.get_log_ident(), (uint) hb.get_ident_len());
error_msg.append(STRING_WITH_LEN(" log_pos ")); error_msg.append(STRING_WITH_LEN(" log_pos "));
llstr(hb.log_pos, llbuf); llstr(hb.log_pos, llbuf);
error_msg.append(llbuf, strlen(llbuf)); error_msg.append(llbuf, strlen(llbuf));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment