small optimization of the previous bugfix

(based on the fact that packet is ALWAYS \0 terminated, see my_net_read)
parent 3144d5eb
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment