From 9e7d870b360b165ac7960814a2fa5bf6011eab1a Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 19 Nov 2012 11:18:40 +0100 Subject: potential crash in the feedback plugin --- plugin/feedback/url_http.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'plugin') 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

...

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, "

"))) { -- cgit v1.2.1