1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-31543: ASAN heap-buffer-overflow in strncpy when fetching keys

using JSON_OBJECT_FILTER_KEYS function

Analysis:
Insufficient buffer size while copying the data.
Fix:
Change buffer size to accomodate all data.
This commit is contained in:
Rucha Deodhar
2024-04-25 01:32:58 +05:30
parent a21e49cbcc
commit 2455f1a93d
3 changed files with 21 additions and 1 deletions

View File

@ -4086,6 +4086,16 @@ SELECT JSON_ARRAY_INTERSECT(c1, c2) FROM t1;
DROP TABLE t1;
--echo #
--echo # MDEV-31543: ASAN heap-buffer-overflow in strncpy when fetching keys using JSON_OBJECT_FILTER_KEYS function
--echo #
SET @arr1='[1,2,"c"]';
SET character_set_database=ucs2;
SET CHARACTER SET utf8;
SET @obj1='{ "a": 1,"b": 2,"c": 3}';
SELECT JSON_OBJECT_FILTER_KEYS (@obj1,@arr1);
--echo #
--echo # End of 11.2 Test
--echo #