diff options
author | Alexander Barkov <alexander.barkov@oracle.com> | 2011-02-18 12:46:55 +0300 |
---|---|---|
committer | Alexander Barkov <alexander.barkov@oracle.com> | 2011-02-18 12:46:55 +0300 |
commit | f4beb9294046ac368cfb66fc3270298a85dbdf4a (patch) | |
tree | f186d667dd96739f271ddf7e93c7389f259051a8 /sql/sql_connect.h | |
parent | 0db53b19b78c01d820463d727b0e73e97c5cd802 (diff) | |
download | mariadb-git-f4beb9294046ac368cfb66fc3270298a85dbdf4a.tar.gz |
Bug#11765108 (Bug#58036) client utf32, utf16, ucs2 should be disallowed, they crash server
Problem: ucs2 was correctly disallowed in "SET NAMES" only,
while mysql_real_connect() and mysql_change_user() still allowed
to use ucs2, which made server crash.
Fix: disallow ucs2 in mysql_real_connect() and mysql_change_user().
@ sql/set_var.cc
Using new function.
@ sql/sql_acl.cc
- Return error if character set initialization failed
- Getting rid of pointer aliasing:
Initialize user_name to NULL, to avoid double free().
@ sql/sql_connect.cc
- in case of unsupported client character set send error and return true
- in case of success return false
@ sql/sql_connect.h
- changing return type for thd_init_client_charset() to bool,
to return errors to the caller
@ sql/sql_parse.h
- introducing a new function, to reuse in all places where we need
to check client character set.
@ tests/mysql_client_test.c
Adding test
Diffstat (limited to 'sql/sql_connect.h')
-rw-r--r-- | sql/sql_connect.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_connect.h b/sql/sql_connect.h index 666db4c6462..ff5a20dfbc2 100644 --- a/sql/sql_connect.h +++ b/sql/sql_connect.h @@ -33,7 +33,7 @@ void reset_mqh(LEX_USER *lu, bool get_them); bool check_mqh(THD *thd, uint check_command); void time_out_user_resource_limits(THD *thd, USER_CONN *uc); void decrease_user_connections(USER_CONN *uc); -void thd_init_client_charset(THD *thd, uint cs_number); +bool thd_init_client_charset(THD *thd, uint cs_number); bool setup_connection_thread_globals(THD *thd); int check_user(THD *thd, enum enum_server_command command, |