From 27cbc507faa302e09ad106eb0967e11318f876a4 Mon Sep 17 00:00:00 2001 From: "vva@eagle.mysql.r18.ru" <> Date: Thu, 5 Jun 2003 16:19:54 -0400 Subject: [PATCH] fixed bug (writting outside mallocced buffer in sql_help.cc) --- sql/sql_help.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/sql_help.cc b/sql/sql_help.cc index 9003d4b36cd..ba7c08ff15f 100644 --- a/sql/sql_help.cc +++ b/sql/sql_help.cc @@ -553,14 +553,14 @@ int send_variant_2_list(MEM_ROOT *mem_root, Protocol *protocol, String **pointers= (String**)alloc_root(mem_root, sizeof(String*)*names->elements); - String **pos= pointers; + String **pos; + String **end= pointers + names->elements; List_iterator it(*names); - while ((*pos++= it++)); + for ( pos= pointers; pos!=end; (*pos++= it++)); qsort(pointers,names->elements,sizeof(String*),string_ptr_cmp); - String **end= pointers + names->elements; for (pos= pointers; pos!=end; pos++) { protocol->prepare_for_resend();