diff options
author | Sergei Golubchik <sergii@pisem.net> | 2012-11-19 11:18:40 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2012-11-19 11:18:40 +0100 |
commit | 9e7d870b360b165ac7960814a2fa5bf6011eab1a (patch) | |
tree | 137b4453363c56ccd81b960537bad88fdc71cc1e | |
parent | 632dc05ded27eeb0976e7a67310749ab4635614b (diff) | |
download | mariadb-git-9e7d870b360b165ac7960814a2fa5bf6011eab1a.tar.gz |
potential crash in the feedback plugin
-rw-r--r-- | plugin/feedback/url_http.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/plugin/feedback/url_http.cc b/plugin/feedback/url_http.cc index 71b67a52807..b0028292707 100644 --- a/plugin/feedback/url_http.cc +++ b/plugin/feedback/url_http.cc @@ -258,18 +258,21 @@ int Url_http::send(const char* data, size_t data_length) Extract the first string between <h1>...</h1> tags and put it as a server reply into the error log. */ + len= 0; for (;;) { - size_t i= vio_read(vio, (uchar*)buf + len, sizeof(buf) - len - 1); + size_t i= sizeof(buf) - len - 1; + if (i) + i= vio_read(vio, (uchar*)buf + len, i); if ((int)i <= 0) break; len+= i; } - if (len && len < sizeof(buf)) + if (len) { char *from; - buf[len+1]= 0; // safety + buf[len]= 0; // safety if ((from= strstr(buf, "<h1>"))) { |