1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

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.
This commit is contained in:
Nuno Carvalho
2012-04-20 22:25:59 +01:00
parent bf4161adae
commit cdaae1692b
4 changed files with 57 additions and 1 deletions

View File

@@ -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;