mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +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:
@ -5171,7 +5171,6 @@ bool check_global_access(THD *thd, ulong want_access)
|
||||
Check stack size; Send error if there isn't enough stack to continue
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef EMBEDDED_LIBRARY
|
||||
|
||||
#if STACK_DIRECTION < 0
|
||||
#define used_stack(A,B) (long) (A - B)
|
||||
@ -5209,7 +5208,7 @@ bool check_stack_overrun(THD *thd, long margin,
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
#endif /* EMBEDDED_LIBRARY */
|
||||
|
||||
|
||||
#define MY_YACC_INIT 1000 // Start with big alloc
|
||||
#define MY_YACC_MAX 32000 // Because of 'short'
|
||||
|
Reference in New Issue
Block a user