summaryrefslogtreecommitdiff
path: root/sql/log_event_old.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-04-20 13:16:03 +0200
committerSergei Golubchik <serg@mariadb.org>2018-04-20 14:33:24 +0200
commit587568b72a0f4bcb284b292f158dea6f65c03487 (patch)
treee9caae1f20e997ce2bc528fc41d1adbe2c2d8bf0 /sql/log_event_old.cc
parentbcb36ee21e2515d17dcf03b760487e64eb780f2b (diff)
parent51c415d97d60cad732d05c9d5516f7fa3fde1df9 (diff)
downloadmariadb-git-587568b72a0f4bcb284b292f158dea6f65c03487.tar.gz
Merge branch '5.5' into 10.0
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 73869e82f72..4d15f231c40 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
@@ -1329,6 +1330,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,