summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-04-30 00:33:06 +0400
committerAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-04-30 00:33:06 +0400
commit85ed11c60d569a54a32cce1588594ee18c43e40a (patch)
treea2457e79f43173dfb97236266c5bb7a47fdbf65f /sql/sql_parse.cc
parent21b8741b57204f784633c6337f9abacaa59ff3e2 (diff)
parent2303a8c6e4dd94eb6b682c61e0ff333c21b188b2 (diff)
downloadmariadb-git-85ed11c60d569a54a32cce1588594ee18c43e40a.tar.gz
Manual merge of mysql-5.1-bugteam to mysql-trunk-merge.
Conflicts: Text conflict in configure.in Text conflict in dbug/dbug.c Text conflict in mysql-test/r/ps.result Text conflict in mysql-test/t/ps.test Text conflict in sql/CMakeLists.txt Text conflict in sql/ha_ndbcluster.cc Text conflict in sql/mysqld.cc Text conflict in sql/sql_plugin.cc Text conflict in sql/sql_table.cc
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 058c6844d15..f83ab95042a 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1160,8 +1160,16 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
We have name + wildcard in packet, separated by endzero
*/
arg_end= strend(packet);
+ uint arg_length= arg_end - packet;
+
+ /* Check given table name length. */
+ if (arg_length >= packet_length || arg_length > NAME_LEN)
+ {
+ my_message(ER_UNKNOWN_COM_ERROR, ER(ER_UNKNOWN_COM_ERROR), MYF(0));
+ break;
+ }
thd->convert_string(&conv_name, system_charset_info,
- packet, (uint) (arg_end - packet), thd->charset());
+ packet, arg_length, thd->charset());
table_list.alias= table_list.table_name= conv_name.str;
packet= arg_end + 1;