summaryrefslogtreecommitdiff
path: root/sql/sql_repl.cc
diff options
context:
space:
mode:
authorNuno Carvalho <nuno.carvalho@oracle.com>2012-04-20 22:25:59 +0100
committerNuno Carvalho <nuno.carvalho@oracle.com>2012-04-20 22:25:59 +0100
commitca33df20942cc50f8038e9cd0ecc846330ebc8ce (patch)
tree3e90fc7337b5e4526065135b09f053c737c88ffa /sql/sql_repl.cc
parent5203d9bb98bc4696b916317045216de1ee55c663 (diff)
downloadmariadb-git-ca33df20942cc50f8038e9cd0ecc846330ebc8ce.tar.gz
BUG#13979418: SHOW BINLOG EVENTS MAY CRASH THE SERVER
The function mysql_show_binlog_events has a local stack variable 'LOG_INFO linfo;', which is assigned to thd->current_linfo, however this variable goes out of scope and is destroyed before clean thd->current_linfo. The problem is solved by moving 'LOG_INFO linfo;' to function scope.
Diffstat (limited to 'sql/sql_repl.cc')
-rw-r--r--sql/sql_repl.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index a2c388ba388..b985805a827 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -1454,6 +1454,8 @@ bool mysql_show_binlog_events(THD* thd)
IO_CACHE log;
File file = -1;
int old_max_allowed_packet= thd->variables.max_allowed_packet;
+ LOG_INFO linfo;
+
DBUG_ENTER("mysql_show_binlog_events");
Log_event::init_show_field_list(&field_list);
@@ -1480,7 +1482,6 @@ bool mysql_show_binlog_events(THD* thd)
char search_file_name[FN_REFLEN], *name;
const char *log_file_name = lex_mi->log_file_name;
pthread_mutex_t *log_lock = mysql_bin_log.get_log_lock();
- LOG_INFO linfo;
Log_event* ev;
unit->set_limit(thd->lex->current_select);
@@ -1572,6 +1573,8 @@ bool mysql_show_binlog_events(THD* thd)
pthread_mutex_unlock(log_lock);
}
+ // Check that linfo is still on the function scope.
+ DEBUG_SYNC(thd, "after_show_binlog_events");
ret= FALSE;