[MDEV-28762] recursive call of some json functions without stack control Created: 2022-06-07  Updated: 2024-01-10  Resolved: 2022-07-20

Status: Closed
Project: MariaDB Server
Component/s: JSON
Affects Version/s: 10.3, 10.4, 10.5, 10.6, 10.7, 10.8
Fix Version/s: 10.3.36, 10.4.26, 10.5.17, 10.6.9, 10.7.5, 10.8.4, 10.9.2

Type: Bug Priority: Blocker
Reporter: Oleksandr Byelkin Assignee: Rucha Deodhar
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-33209 Stack overflow in main.json_debug_non... Confirmed

 Description   

do_merge() (sql/item_jsonfunc.c) has recursive calls but do not have check_stack_overrun



 Comments   
Comment by Rucha Deodhar [ 2022-06-22 ]

Patch:
10.3: https://github.com/MariaDB/server/commit/dbe39f14fede0f5fbe0ce7470ae4fde21767842c
10.6: https://github.com/MariaDB/server/commit/0ea221e12bb4b298b728cd0e0f2651173cbe2347
10.9:
https://github.com/MariaDB/server/commit/5ad14ab272e7770a52f3cf20369e7ab7b14b51d6

Comment by Oleksandr Byelkin [ 2022-07-20 ]

OK to push

Comment by Marko Mäkelä [ 2022-07-26 ]

The debug instrumentation was optimized away by clang-15 but not GCC 12, so I improved with it a call to a non-inline function.

Generated at Thu Feb 08 10:03:16 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.