summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authorVladislav Vaintroub <vvaintroub@mysql.com>2010-02-23 12:48:26 +0100
committerVladislav Vaintroub <vvaintroub@mysql.com>2010-02-23 12:48:26 +0100
commit94bd96e815333955974b53ca42e4480c8754b75c (patch)
tree0c315bcaeaae5bf2acb6a94e129fe358474a33f5 /sql/item_cmpfunc.cc
parentc88200172e0de06df30d4466f6c9de43a318b7ac (diff)
downloadmariadb-git-94bd96e815333955974b53ca42e4480c8754b75c.tar.gz
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.
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc4
1 files changed, 0 insertions, 4 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 1da383ce3e9..ed465cbe280 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -2865,9 +2865,7 @@ bool Item_func_case::fix_fields(THD *thd, Item **ref)
buff should match stack usage from
Item_func_case::val_int() -> Item_func_case::find_item()
*/
-#ifndef EMBEDDED_LIBRARY
uchar buff[MAX_FIELD_WIDTH*2+sizeof(String)*2+sizeof(String*)*2+sizeof(double)*2+sizeof(longlong)*2];
-#endif
bool res= Item_func::fix_fields(thd, ref);
/*
Call check_stack_overrun after fix_fields to be sure that stack variable
@@ -4081,9 +4079,7 @@ Item_cond::fix_fields(THD *thd, Item **ref)
DBUG_ASSERT(fixed == 0);
List_iterator<Item> li(list);
Item *item;
-#ifndef EMBEDDED_LIBRARY
uchar buff[sizeof(char*)]; // Max local vars in function
-#endif
not_null_tables_cache= used_tables_cache= 0;
const_item_cache= 1;
/*