1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Bug#21042 mysql client segfaults on importing a mysqldump export

- Use strmake, that will both protect the buffer and make sure it's terminated by a zero
 - Add test case


client/mysql.cc:
  Use strmake instead of strxnmov as that function will make sure the string is terminated by 0
mysql-test/r/mysql.result:
  Update test result
mysql-test/t/mysql.test:
  Add test case
This commit is contained in:
unknown
2006-07-31 14:22:32 +02:00
parent d55c770ac0
commit 71c896c2bf
3 changed files with 8 additions and 1 deletions

View File

@ -86,6 +86,12 @@ create table t1(a int, b varchar(255), c int);
--exec $MYSQL test -e "desc t1\g"
drop table t1;
#
# Bug#21042 mysql client segfaults on importing a mysqldump export
#
--error 1
--exec $MYSQL test -e "connect verylongdatabasenamethatshouldblowthe256byteslongbufferincom_connectfunctionxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxendcccccccdxxxxxxxxxxxxxxxxxkskskskskkskskskskskskskskskskkskskskskkskskskskskskskskskend" 2>&1
--echo End of 5.0 tests