summaryrefslogtreecommitdiff
path: root/sql/log_event_old.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-04-24 09:39:45 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2018-04-24 09:39:45 +0300
commit4cd7979c56130194cc3742e1037998d11f98c047 (patch)
tree70131981da1d874d68b9e8cc8e7bf293e405907e /sql/log_event_old.cc
parent619dc2b24f26aea29345dc3f3289bed406738025 (diff)
parent9c34a4124d67d9e3f70837eaeb11290f35e8f8d0 (diff)
downloadmariadb-git-4cd7979c56130194cc3742e1037998d11f98c047.tar.gz
Merge 10.1 into 10.2
Diffstat (limited to 'sql/log_event_old.cc')
-rw-r--r--sql/log_event_old.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc
index 68ffa32fafe..ce9bca920fe 100644
--- a/sql/log_event_old.cc
+++ b/sql/log_event_old.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2007, 2016, Oracle and/or its affiliates.
+/* Copyright (c) 2007, 2018, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2018, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1233,6 +1234,13 @@ Old_rows_log_event::Old_rows_log_event(const char *buf, uint event_len,
DBUG_PRINT("debug", ("Reading from %p", ptr_after_width));
m_width = net_field_length(&ptr_after_width);
DBUG_PRINT("debug", ("m_width=%lu", m_width));
+ /* Avoid reading out of buffer */
+ if (ptr_after_width + m_width > (uchar *)buf + event_len)
+ {
+ m_cols.bitmap= NULL;
+ DBUG_VOID_RETURN;
+ }
+
/* if my_bitmap_init fails, catched in is_valid() */
if (likely(!my_bitmap_init(&m_cols,
m_width <= sizeof(m_bitbuf)*8 ? m_bitbuf : NULL,