summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <cmiller@zippy.cornsilk.net>2007-06-12 08:48:30 -0400
committerunknown <cmiller@zippy.cornsilk.net>2007-06-12 08:48:30 -0400
commit7c81e002351ba997924a13ba56390ddc6c855ae4 (patch)
tree8e75b2688c403604f4abac02958e79e1add8fbe2
parenta3cec3e0a9e69101f2103521ec33414712078fa4 (diff)
parent3a364d517246d6d571a3c5eecac99dbee6dac7db (diff)
downloadmariadb-git-7c81e002351ba997924a13ba56390ddc6c855ae4.tar.gz
Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-4.1-maint
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint-2 sql/sql_parse.cc: Auto merged
-rw-r--r--sql/sql_parse.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 1d76e2b7e22..709083f736a 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -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
password. New clients send the size (1 byte) + string (not null
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= passwd;
uint passwd_len= thd->client_capabilities & CLIENT_SECURE_CONNECTION ?
- *passwd++ : strlen(passwd);
+ (uchar)(*passwd++) : strlen(passwd);
db+= passwd_len + 1;
#ifndef EMBEDDED_LIBRARY
/* Small check for incoming packet */