Commit 5965e887 authored by unknown's avatar unknown

Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint

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

parents d447929a 7c81e002
...@@ -1700,11 +1700,14 @@ bool dispatch_command(enum enum_server_command command, THD *thd, ...@@ -1700,11 +1700,14 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
Old clients send null-terminated string ('\0' for empty string) for Old clients send null-terminated string ('\0' for empty string) for
password. New clients send the size (1 byte) + string (not null password. New clients send the size (1 byte) + string (not null
terminated, so also '\0' for empty string). terminated, so also '\0' for empty string).
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.
*/ */
char db_buff[NAME_LEN+1]; // buffer to store db in utf8 char db_buff[NAME_LEN+1]; // buffer to store db in utf8
char *db= passwd; char *db= passwd;
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+= passwd_len + 1; db+= passwd_len + 1;
#ifndef EMBEDDED_LIBRARY #ifndef EMBEDDED_LIBRARY
/* Small check for incoming packet */ /* Small check for incoming packet */
......
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