Commit 9e7d870b authored by Sergei Golubchik's avatar Sergei Golubchik

potential crash in the feedback plugin

parent 632dc05d
...@@ -258,18 +258,21 @@ int Url_http::send(const char* data, size_t data_length) ...@@ -258,18 +258,21 @@ int Url_http::send(const char* data, size_t data_length)
Extract the first string between <h1>...</h1> tags Extract the first string between <h1>...</h1> tags
and put it as a server reply into the error log. and put it as a server reply into the error log.
*/ */
len= 0;
for (;;) 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) if ((int)i <= 0)
break; break;
len+= i; len+= i;
} }
if (len && len < sizeof(buf)) if (len)
{ {
char *from; char *from;
buf[len+1]= 0; // safety buf[len]= 0; // safety
if ((from= strstr(buf, "<h1>"))) if ((from= strstr(buf, "<h1>")))
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment