summaryrefslogtreecommitdiff
path: root/sql/mysql_priv.h
diff options
context:
space:
mode:
authorDmitry Shulga <Dmitry.Shulga@oracle.com>2011-03-15 17:36:12 +0600
committerDmitry Shulga <Dmitry.Shulga@oracle.com>2011-03-15 17:36:12 +0600
commit6c2f5e306ca3fa621cd25cedd49181d6e0d5cbc6 (patch)
treea5dc8beae05172872e0c5adc5f06bb1144c0be41 /sql/mysql_priv.h
parent8da2b4f5d756c3b6993cd4be734cf2a49eeb81a5 (diff)
downloadmariadb-git-6c2f5e306ca3fa621cd25cedd49181d6e0d5cbc6.tar.gz
Fixed Bug#11764168 "56976: SEVERE DENIAL OF SERVICE IN PREPARED STATEMENTS".
The problem was that server didn't check resulting size of prepared statement argument which was set using mysql_send_long_data() API. By calling mysql_send_long_data() several times it was possible to create overly big string and thus force server to allocate memory for it. There was no way to limit this allocation. The solution is to add check for size of result string against value of max_long_data_size start-up parameter. When intermediate string exceeds max_long_data_size value an appropriate error message is emitted. We can't use existing max_allowed_packet parameter for this purpose since its value is limited by 1GB and therefore using it as a limit for data set through mysql_send_long_data() API would have been an incompatible change. Newly introduced max_long_data_size parameter gets value from max_allowed_packet parameter unless its value is specified explicitly. This new parameter is marked as deprecated and will be eventually replaced by max_allowed_packet parameter. Value of max_long_data_size parameter can be set only at server startup.
Diffstat (limited to 'sql/mysql_priv.h')
-rw-r--r--sql/mysql_priv.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 67631b265ab..8f9a9080d12 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -1965,6 +1965,7 @@ extern my_bool relay_log_purge, opt_innodb_safe_binlog, opt_innodb;
extern uint test_flags,select_errors,ha_open_options;
extern uint protocol_version, mysqld_port, dropping_tables;
extern uint delay_key_write_options;
+extern ulong max_long_data_size;
#endif /* MYSQL_SERVER */
#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
extern MYSQL_PLUGIN_IMPORT uint lower_case_table_names;