diff options
author | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2009-08-10 15:46:20 -0300 |
---|---|---|
committer | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2009-08-10 15:46:20 -0300 |
commit | 19b325499e08a7378d01d9eebb2b431821c35dc0 (patch) | |
tree | 6585c71f3fae15baed31782015d75e99c441df20 /tests | |
parent | 527e5fd3a246cc21bdaa3e15952b61bd3e13ebcd (diff) | |
parent | c7163c630a7ab5c9770c9ae07355acc531f110a1 (diff) | |
download | mariadb-git-19b325499e08a7378d01d9eebb2b431821c35dc0.tar.gz |
Manual merge.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/mysql_client_test.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 75789c1beb2..9d61d6edd3e 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -17947,6 +17947,34 @@ static void test_bug41078(void) DBUG_VOID_RETURN; } +/** + Bug#45010: invalid memory reads during parsing some strange statements +*/ +static void test_bug45010() +{ + int rc; + const char query1[]= "select a.\x80", + query2[]= "describe `table\xef"; + + DBUG_ENTER("test_bug45010"); + myheader("test_bug45010"); + + rc= mysql_query(mysql, "set names utf8"); + myquery(rc); + + /* \x80 (-128) could be used as a index of ident_map. */ + rc= mysql_real_query(mysql, query1, sizeof(query1) - 1); + DIE_UNLESS(rc); + + /* \xef (-17) could be used to skip 3 bytes past the buffer end. */ + rc= mysql_real_query(mysql, query2, sizeof(query2) - 1); + DIE_UNLESS(rc); + + rc= mysql_query(mysql, "set names default"); + myquery(rc); + + DBUG_VOID_RETURN; +} /** Bug#44495: Prepared Statement: @@ -18301,6 +18329,7 @@ static struct my_tests_st my_tests[]= { { "test_change_user", test_change_user }, { "test_bug30472", test_bug30472 }, { "test_bug20023", test_bug20023 }, + { "test_bug45010", test_bug45010 }, { "test_bug31418", test_bug31418 }, { "test_bug31669", test_bug31669 }, { "test_bug28386", test_bug28386 }, |