Fixed bad code [#CLICKHOUSE-2]

This commit is contained in:
Alexey Milovidov 2018-11-25 03:15:43 +03:00
parent 141e9799e4
commit af9ad0f8ae

View File

@ -555,7 +555,7 @@ struct CutURLParameterImpl
do
{
const char * query_string_begin = find_first_symbols<'?', '#'>(url_begin, url_end);
if (query_string_begin == url_end)
if (query_string_begin + 1 >= url_end)
break;
const char * pos = strstr(query_string_begin + 1, param_str);
@ -642,7 +642,7 @@ public:
{
first = false;
pos = find_first_symbols<'?', '#'>(pos, end);
if (pos == end)
if (pos + 1 >= end)
return false;
++pos;
}
@ -731,7 +731,7 @@ public:
else
pos = find_first_symbols<'&', '#'>(pos, end);
if (pos == end)
if (pos + 1 >= end)
return false;
++pos;