summaryrefslogtreecommitdiff
path: root/sql/sql_delete.cc
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2007-01-19 18:34:09 +0300
committerunknown <evgen@moonbone.local>2007-01-19 18:34:09 +0300
commit5effa05d3f31971461da851f0650951e1e488421 (patch)
tree2261174445362ee68b36085a334b263371a58648 /sql/sql_delete.cc
parent759a028c20412d26802d479724de932a288a3e43 (diff)
downloadmariadb-git-5effa05d3f31971461da851f0650951e1e488421.tar.gz
Bug#25172: Not checked buffer size leads to a server crash.
After fix for bug#21798 JOIN stores the pointer to the buffer for sorting fields. It is used while sorting for grouping and for ordering. If ORDER BY clause has more elements then the GROUP BY clause then a memory overrun occurs. Now the length of the ORDER BY list is always passed to the make_unireg_sortorder() function and it allocates buffer big enough to be used for bigger list. sql/sql_delete.cc: Bug#25172: Not checked buffer size leads to a server crash. Length parameter is initialized to 0 for the make_unireg_sortorder() function. sql/sql_select.cc: Bug#25172: Not checked buffer size leads to a server crash. Now the length of the ORDER BY list is always passed to the make_unireg_sortorder() function and it allocates buffer big enough to be used for bigger list. sql/sql_table.cc: Bug#25172: Not checked buffer size leads to a server crash. Length parameter is initialized to 0 for the make_unireg_sortorder() function. sql/sql_update.cc: Bug#25172: Not checked buffer size leads to a server crash. Length parameter is initialized to 0 for the make_unireg_sortorder() function. mysql-test/r/select.result: Added a test case for bug#25172: Not checked buffer size leads to a server crash. mysql-test/t/select.test: Added a test case for bug#25172: Not checked buffer size leads to a server crash.
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r--sql/sql_delete.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 7752ac80adb..e8291edda5d 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -142,7 +142,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
if (order && order->elements)
{
- uint length;
+ uint length= 0;
SORT_FIELD *sortorder;
TABLE_LIST tables;
List<Item> fields;