diff options
author | Venkatesh Duggirala <venkatesh.duggirala@oracle.com> | 2013-12-17 22:11:22 +0530 |
---|---|---|
committer | Venkatesh Duggirala <venkatesh.duggirala@oracle.com> | 2013-12-17 22:11:22 +0530 |
commit | b0a5086c368b516f47b992b14cacc6acc5822f5e (patch) | |
tree | abc3738abd56fe93dd6a945ef5605b39f7cf6420 /sql/log_event_old.h | |
parent | a5eccbc33a11db49f85c4a84108b70d8ae3ad3ef (diff) | |
download | mariadb-git-b0a5086c368b516f47b992b14cacc6acc5822f5e.tar.gz |
Bug#17632978 SLAVE CRASHES IF ROW EVENT IS CORRUPTED
(MYSQLBINLOG -V CRASHES WITH THAT BINLOG)
Problem: If slave receives a corrupted row event,
slave server is crashing.
Analysis: When slave is unpacking the row event, it is
not validating the data before applying the event. If the
data is corrupted for eg: the length of a field is wrong,
it could end up reading wrong data leading to a crash.
A similar problem happens when mysqlbinlog tool is used
against a corrupted binlog using '-v' option. Due to -v
option, the tool tries to print the values of all the
fields. Corrupted field length could lead to a crash.
Fix: Before unpacking the field, a verification
will be made on the length. If it falls into the event
range, only then it will be unpacked. Otherwise,
"ER_SLAVE_CORRUPT_EVENT" error will be thrown.
Incase mysqlbinlog -v case, the field value will not be
printed and the processing of the file will be stopped.
Diffstat (limited to 'sql/log_event_old.h')
-rw-r--r-- | sql/log_event_old.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sql/log_event_old.h b/sql/log_event_old.h index ab8196c0979..04678ffff84 100644 --- a/sql/log_event_old.h +++ b/sql/log_event_old.h @@ -203,10 +203,8 @@ protected: { DBUG_ASSERT(m_table); ASSERT_OR_RETURN_ERROR(m_curr_row < m_rows_end, HA_ERR_CORRUPT_EVENT); - int const result= ::unpack_row(rli, m_table, m_width, m_curr_row, &m_cols, - &m_curr_row_end, &m_master_reclength); - ASSERT_OR_RETURN_ERROR(m_curr_row_end <= m_rows_end, HA_ERR_CORRUPT_EVENT); - return result; + return ::unpack_row(rli, m_table, m_width, m_curr_row, &m_cols, + &m_curr_row_end, &m_master_reclength, m_rows_end); } #endif |