diff options
author | Nirbhay Choubey <nirbhay@mariadb.com> | 2014-12-22 20:09:25 -0500 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@mariadb.com> | 2014-12-22 20:09:25 -0500 |
commit | eda3db826f741b6cb62bb6903bd6b55a6aca4c3a (patch) | |
tree | 6af5f833c5ff996e73796708525e2d8dcfc8b859 /sql/log_event.cc | |
parent | cb47155c68f38c6931fd539a8615373199b4ee64 (diff) | |
parent | 0f64a927a93239f7f0f5e413b893f7fc1233de15 (diff) | |
download | mariadb-git-eda3db826f741b6cb62bb6903bd6b55a6aca4c3a.tar.gz |
Merge revisions from maria/5.5 (5.5.41)
bzr merge -r4393 lp:maria/5.5
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r-- | sql/log_event.cc | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc index e6fdb6943af..658c93bbc26 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1586,7 +1586,7 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len, ev = new Execute_load_log_event(buf, event_len, description_event); break; case START_EVENT_V3: /* this is sent only by MySQL <=4.x */ - ev = new Start_log_event_v3(buf, description_event); + ev = new Start_log_event_v3(buf, event_len, description_event); break; case STOP_EVENT: ev = new Stop_log_event(buf, description_event); @@ -4163,11 +4163,17 @@ void Start_log_event_v3::print(FILE* file, PRINT_EVENT_INFO* print_event_info) Start_log_event_v3::Start_log_event_v3() */ -Start_log_event_v3::Start_log_event_v3(const char* buf, +Start_log_event_v3::Start_log_event_v3(const char* buf, uint event_len, const Format_description_log_event *description_event) - :Log_event(buf, description_event) + :Log_event(buf, description_event), binlog_version(BINLOG_VERSION) { + if (event_len < (uint)description_event->common_header_len + + ST_COMMON_HEADER_LEN_OFFSET) + { + server_version[0]= 0; + return; + } buf+= description_event->common_header_len; binlog_version= uint2korr(buf+ST_BINLOG_VER_OFFSET); memcpy(server_version, buf+ST_SERVER_VER_OFFSET, @@ -4467,9 +4473,12 @@ Format_description_log_event(const char* buf, const Format_description_log_event* description_event) - :Start_log_event_v3(buf, description_event), event_type_permutation(0) + :Start_log_event_v3(buf, event_len, description_event), + common_header_len(0), post_header_len(NULL), event_type_permutation(0) { DBUG_ENTER("Format_description_log_event::Format_description_log_event(char*,...)"); + if (!Start_log_event_v3::is_valid()) + DBUG_VOID_RETURN; /* sanity check */ buf+= LOG_EVENT_MINIMAL_HEADER_LEN; if ((common_header_len=buf[ST_COMMON_HEADER_LEN_OFFSET]) < OLD_HEADER_LEN) DBUG_VOID_RETURN; /* sanity check */ |