From 1409dc6f594af5b333e87db8a93a69732b886206 Mon Sep 17 00:00:00 2001 From: "serg@sergbook.mysql.com" <> Date: Tue, 25 Apr 2006 16:41:12 -0700 Subject: [PATCH] small optimization of the previous bugfix (based on the fact that packet is ALWAYS \0 terminated, see my_net_read) --- sql/sql_parse.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 93f696f6d49..8f8eacbb77b 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -647,7 +647,7 @@ check_connections(THD *thd) char *db=0; if (thd->client_capabilities & CLIENT_CONNECT_WITH_DB) db=strend(passwd)+1; - if (strend(db ? db : passwd) - (char*)net->read_pos > pkt_len) + if ((db ? db : passwd) - (char*)net->read_pos > pkt_len) { inc_host_errors(&thd->remote.sin_addr); return ER_HANDSHAKE_ERROR;