summaryrefslogtreecommitdiff
path: root/sql/log_event.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2015-01-21 12:03:02 +0100
committerSergei Golubchik <sergii@pisem.net>2015-01-21 12:03:02 +0100
commitd9c01e4b4ac6a7e2bdbcaf71819fa3d4f5269840 (patch)
tree4f86f6ce4e298430e313ed70f2225b3f29485f51 /sql/log_event.cc
parentd854a254b84595b3a8f3a4d8083a2b997d59912e (diff)
parent8bc712e481a18976853fa57a7be77aab6159d431 (diff)
downloadmariadb-git-d9c01e4b4ac6a7e2bdbcaf71819fa3d4f5269840.tar.gz
5.5 merge
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r--sql/log_event.cc16
1 files changed, 12 insertions, 4 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index d568b91a1e2..dd272ac52cd 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -1669,7 +1669,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);
@@ -4662,11 +4662,16 @@ 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 < LOG_EVENT_MINIMAL_HEADER_LEN + ST_COMMON_HEADER_LEN_OFFSET)
+ {
+ server_version[0]= 0;
+ return;
+ }
buf+= LOG_EVENT_MINIMAL_HEADER_LEN;
binlog_version= uint2korr(buf+ST_BINLOG_VER_OFFSET);
memcpy(server_version, buf+ST_SERVER_VER_OFFSET,
@@ -4971,9 +4976,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 */