diff options
author | unknown <tnurnberg@sin.intern.azundris.com> | 2007-10-18 11:15:32 +0200 |
---|---|---|
committer | unknown <tnurnberg@sin.intern.azundris.com> | 2007-10-18 11:15:32 +0200 |
commit | 78a13fa46da14bb3676e0866c572483da31daea0 (patch) | |
tree | 4ab297178d0dba6ed8a0b1b38bddae4c458f43e5 | |
parent | 151e4db0d5b9242dc2fb46e007a96cf950d23052 (diff) | |
parent | cd9d89a75d4cd5e9408cd34e6229910acf23cdc1 (diff) | |
download | mariadb-git-78a13fa46da14bb3676e0866c572483da31daea0.tar.gz |
Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into sin.intern.azundris.com:/misc/mysql/31588/41-31588
-rw-r--r-- | mysql-test/r/variables.result | 3 | ||||
-rw-r--r-- | mysql-test/t/variables.test | 9 | ||||
-rw-r--r-- | sql/set_var.cc | 2 |
3 files changed, 12 insertions, 2 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 diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 808dc0973d4..371cd6bc9b1 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -447,4 +447,11 @@ set @test = @@query_prealloc_size; set @@query_prealloc_size = @test; select @@query_prealloc_size = @test; -# End of 4.1 tests +# +# Bug#31588 buffer overrun when setting variables +# +# Buffer-size Off By One. Should throw valgrind-warning without fix #31588. +--error 1231 +set global sql_mode=repeat('a',80); + +--echo End of 4.1 tests diff --git a/sql/set_var.cc b/sql/set_var.cc index 520ee5c9f70..1d18eba30a8 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1573,7 +1573,7 @@ bool sys_var::check_set(THD *thd, set_var *var, TYPELIB *enum_names) ¬_used)); if (error_len) { - strmake(buff, error, min(sizeof(buff), error_len)); + strmake(buff, error, min(sizeof(buff) - 1, error_len)); goto err; } } |