summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorunknown <msvensson@pilot.(none)>2007-08-23 20:24:48 +0200
committerunknown <msvensson@pilot.(none)>2007-08-23 20:24:48 +0200
commit50911dec3ee85acbfb5c7f0211fb5cde472a0d1e (patch)
tree8a130aa21fb0a083ad7f5a4cc8417eb157330853 /sql/sql_show.cc
parente878be4cc9608b2879cb8ed84052dfe19aa4f375 (diff)
downloadmariadb-git-50911dec3ee85acbfb5c7f0211fb5cde472a0d1e.tar.gz
Bug#30593 No cipher list returned for "SHOW STATUS LIKE 'Ssl_cipher_list'"
- Move increment of "i" to "increment section" of for loop - Protect against writing after end of "buff"(backport from 5.1) sql/sql_show.cc: - Move the increment of i to "increment" section of for loop. Since "i" was initially 0 the for loop exited immediately - Add protection for writing after end of "buff"
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 05a847b3830..1f408bbaf40 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1739,12 +1739,13 @@ static bool show_status_array(THD *thd, const char *wild,
if (thd->net.vio->ssl_arg)
{
char *to= buff;
- for (int i=0 ; i++ ;)
+ char *buff_end= buff + sizeof(buff);
+ for (int i= 0; to < buff_end; i++)
{
const char *p= SSL_get_cipher_list((SSL*) thd->net.vio->ssl_arg,i);
if (p == NULL)
break;
- to= strmov(to, p);
+ to= strnmov(to, p, buff_end-to-1);
*to++= ':';
}
if (to != buff)