summaryrefslogtreecommitdiff
path: root/mysql-test/r/variables.result
diff options
context:
space:
mode:
authorunknown <tnurnberg@sin.intern.azundris.com>2007-10-18 10:47:54 +0200
committerunknown <tnurnberg@sin.intern.azundris.com>2007-10-18 10:47:54 +0200
commitcd9d89a75d4cd5e9408cd34e6229910acf23cdc1 (patch)
treed5f9a4b59eab9b021a873e89e87187e3d3765c5b /mysql-test/r/variables.result
parent77d786b5a0cd303d30b9a22a044b916078551e6c (diff)
downloadmariadb-git-cd9d89a75d4cd5e9408cd34e6229910acf23cdc1.tar.gz
Bug#31588: buffer overrun when setting variables
Buffer used when setting variables was not dimensioned to accomodate trailing '\0'. An overflow by one character was therefore possible. CS corrects limits to prevent such overflows. mysql-test/r/variables.result: Try to overflow buffer used for setting system variables. Unpatched server should throw a valgrind warning here. Actual value and error message irrelevant, only length counts. mysql-test/t/variables.test: Try to overflow buffer used for setting system variables. sql/set_var.cc: Adjust maximum number of characters we can store in 'buff' by one as strmake() will write a terminating '\0'.
Diffstat (limited to 'mysql-test/r/variables.result')
-rw-r--r--mysql-test/r/variables.result3
1 files changed, 3 insertions, 0 deletions
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index 14f1eb7d306..a5b6c308969 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -561,3 +561,6 @@ set @@query_prealloc_size = @test;
select @@query_prealloc_size = @test;
@@query_prealloc_size = @test
1
+set global sql_mode=repeat('a',80);
+ERROR 42000: Variable 'sql_mode' can't be set to the value of 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
+End of 4.1 tests