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

MDEV-25754 ASAN: stack-buffer-overflow in Field_newdate::val_str()

Problem was that Field_newdate() didn't allocate a string big enough for
the result.
This commit is contained in:
Monty
2021-06-07 18:28:27 +03:00
parent b1009ddfc9
commit 233590a48d
3 changed files with 21 additions and 2 deletions

View File

@ -24,3 +24,12 @@ CREATE TABLE t1 (a DECIMAL(15,11) ZEROFILL);
INSERT INTO t1 (a) VALUES (0.1),(0.2);
SELECT length(ENCRYPT(a)) AS f, COUNT(*) FROM t1 GROUP BY f;
DROP TABLE t1;
--echo #
--echo # MDEV-25754 ASAN: stack-buffer-overflow in Field_newdate::val_str
--echo #
CREATE TABLE t1 (d DATE);
INSERT INTO t1 VALUES ('1920-03-02'),('2020-12-01');
SELECT LENGTH(CONCAT_WS(d, ' ')) FROM t1;
DROP TABLE t1;