Skip to content

Commit

Permalink
Use get_ident_len in heartbeat event error messages
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
markus456 authored and robertbindar committed Jan 13, 2020
1 parent 3c94c5b commit 5683c11
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sql/slave.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4444,7 +4444,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len)
error= ER_SLAVE_HEARTBEAT_FAILURE;
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(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 "));
llstr(hb.log_pos, llbuf);
error_msg.append(llbuf, strlen(llbuf));
Expand All @@ -4471,7 +4471,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len)
error= ER_SLAVE_HEARTBEAT_FAILURE;
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(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 "));
llstr(hb.log_pos, llbuf);
error_msg.append(llbuf, strlen(llbuf));
Expand Down

0 comments on commit 5683c11

Please sign in to comment.