mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Bug#43201 : Stack overrun when running sp-error test.
It appears that stack overflow checks for recusrive stored procedure calls, that run in the normal server, did not work in embedded and were dummified with preprocessor magic( #ifndef EMBEDDED_SERVER ). The fix is to remove ifdefs, there is no reason not to run overflow checks and crash in deeply recursive calls. Note: Start of the stack (thd->thread_stack variable) in embedded is not necessarily exact but stil provides the best guess. Unless the caller of mysql_read_connect() is already deep in the stack, thd->thread_stack variable should approximate stack start address well.
This commit is contained in:
@ -2266,9 +2266,7 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
|
||||
keys_to_use.intersect(head->keys_in_use_for_query);
|
||||
if (!keys_to_use.is_clear_all())
|
||||
{
|
||||
#ifndef EMBEDDED_LIBRARY // Avoid compiler warning
|
||||
uchar buff[STACK_BUFF_ALLOC];
|
||||
#endif
|
||||
MEM_ROOT alloc;
|
||||
SEL_TREE *tree= NULL;
|
||||
KEY_PART *key_parts;
|
||||
|
Reference in New Issue
Block a user