diff options
author | Sergei Golubchik <serg@mariadb.org> | 2017-07-18 16:42:40 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2017-07-18 16:42:40 +0200 |
commit | 58aaae6f2a23e68b23727016844d177f178ea8ff (patch) | |
tree | 501ef295863d871bd8e5736a0d24c08ef5b767f3 | |
parent | 172e3a1bc6ab1e38dd8be074b2c10cc734456e35 (diff) | |
download | mariadb-git-58aaae6f2a23e68b23727016844d177f178ea8ff.tar.gz |
ensure that filename in COM_BINLOG_DUMP isn't too long
-rw-r--r-- | sql/sql_parse.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 1d596ed9df7..ba0520de4bb 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1271,9 +1271,12 @@ bool dispatch_command(enum enum_server_command command, THD *thd, kill_zombie_dump_threads(slave_server_id); thd->server_id = slave_server_id; - general_log_print(thd, command, "Log: '%s' Pos: %ld", packet+10, - (long) pos); - mysql_binlog_send(thd, thd->strdup(packet + 10), (my_off_t) pos, flags); + const char *name= packet + 10; + size_t nlen= strlen(name); + + general_log_print(thd, command, "Log: '%s' Pos: %lu", name, pos); + if (nlen < FN_REFLEN) + mysql_binlog_send(thd, thd->strmake(name, nlen), (my_off_t)pos, flags); unregister_slave(thd,1,1); /* fake COM_QUIT -- if we get here, the thread needs to terminate */ error = TRUE; |