summaryrefslogtreecommitdiff
path: root/sql/sql_help.cc
diff options
context:
space:
mode:
authorunknown <vva@eagle.mysql.r18.ru>2003-06-05 16:19:54 -0400
committerunknown <vva@eagle.mysql.r18.ru>2003-06-05 16:19:54 -0400
commitd9a6a9aca610e715d0b0698c1447f6550e6f7965 (patch)
treed0ab433fd7050c93023ecad3c376e66b8bb32313 /sql/sql_help.cc
parent020baadcfebbd0f2248d9a3fa15f29d6e9d954b4 (diff)
downloadmariadb-git-d9a6a9aca610e715d0b0698c1447f6550e6f7965.tar.gz
fixed bug (writting outside mallocced buffer in sql_help.cc)
sql/sql_help.cc: fixed bug (writting outside mallocced buffer)
Diffstat (limited to 'sql/sql_help.cc')
-rw-r--r--sql/sql_help.cc6
1 files 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<String> 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();