diff options
author | Markus Mäkelä <markus456@gmail.com> | 2019-12-05 07:58:02 +0200 |
---|---|---|
committer | Robert Bindar <robert@mariadb.org> | 2020-01-13 14:50:02 +0200 |
commit | 5683c113b817644ffa5ba13c2485ce259250a8f3 (patch) | |
tree | eb5776453ea45b1331927c4c2184038270067ea2 /sql | |
parent | 3c94c5b8fab0c3bb0febe62d72b89bc8d51c3932 (diff) | |
download | mariadb-git-5683c113b817644ffa5ba13c2485ce259250a8f3.tar.gz |
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.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/slave.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/slave.cc b/sql/slave.cc index a8946c69d18..ae1c5ca2cf8 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -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)); @@ -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)); |