Commit c0a7c40b authored by unknown's avatar unknown

Merge zippy.cornsilk.net:/home/cmiller/work/mysql/41gca

into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint-2


sql/sql_parse.cc:
  Auto merged
parents 1a2cc367 d0c9d6cb
...@@ -1009,9 +1009,12 @@ static int check_connection(THD *thd) ...@@ -1009,9 +1009,12 @@ static int check_connection(THD *thd)
Old clients send null-terminated string as password; new clients send Old clients send null-terminated string as password; new clients send
the size (1 byte) + string (not null-terminated). Hence in case of empty the size (1 byte) + string (not null-terminated). Hence in case of empty
password both send '\0'. password both send '\0'.
Cast *passwd to an unsigned char, so that it doesn't extend the sign for
*passwd > 127 and become 2**32-127 after casting to uint.
*/ */
uint passwd_len= thd->client_capabilities & CLIENT_SECURE_CONNECTION ? uint passwd_len= thd->client_capabilities & CLIENT_SECURE_CONNECTION ?
*passwd++ : strlen(passwd); (uchar)(*passwd++) : strlen(passwd);
db= thd->client_capabilities & CLIENT_CONNECT_WITH_DB ? db= thd->client_capabilities & CLIENT_CONNECT_WITH_DB ?
db + passwd_len + 1 : 0; db + passwd_len + 1 : 0;
uint db_len= db ? strlen(db) : 0; uint db_len= db ? strlen(db) : 0;
......
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