1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-32376 SHOW CREATE DATABASE statement crashes the server when db name contains some unicode characters, ASAN stack-buffer-overflow

Adding the test for the length of lex->name into show_create_db().

Without this test writes beyond the end of db_name_buff were possible
upon a too long database name.
This commit is contained in:
Alexander Barkov
2024-06-10 09:31:14 +04:00
parent bf0aa99aeb
commit 21f56583bf
3 changed files with 33 additions and 0 deletions

View File

@ -1935,4 +1935,13 @@ DROP TABLE t1;
CREATE TABLE t1 (id1 INT, id2 INT, primary key (id1), unique index (id2) visible);
drop table t1;
--echo #
--echo # MDEV-32376 SHOW CREATE DATABASE statement crashes the server when db name contains some unicode characters, ASAN stack-buffer-overflow
--echo #
SET NAMES utf8mb3;
--error ER_WRONG_DB_NAME
SHOW CREATE DATABASE `#testone#■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■`;
SET NAMES DEFAULT;
--echo # End of 10.5 Test