diff options
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index c044d17f0a9..215a6723db9 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -875,8 +875,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd, } thd->free_list=0; table_list.name=table_list.real_name=thd->strdup(packet); - thd->query=fields=thd->strdup(strend(packet)+1); - thd->query_length=strlen(thd->query); + packet=strend(packet)+1; + if (!(thd->query=fields=thd->memdup(packet,thd->query_length+1))) + break; mysql_log.write(thd,command,"%s %s",table_list.real_name,fields); remove_escape(table_list.real_name); // This can't have wildcards |