From af9ad0f8ae6bb968838e86830f6bd50f0e234d97 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sun, 25 Nov 2018 03:15:43 +0300 Subject: [PATCH] Fixed bad code [#CLICKHOUSE-2] --- dbms/src/Functions/FunctionsURL.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dbms/src/Functions/FunctionsURL.h b/dbms/src/Functions/FunctionsURL.h index cfd5f11406d..639f4d850e3 100644 --- a/dbms/src/Functions/FunctionsURL.h +++ b/dbms/src/Functions/FunctionsURL.h @@ -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;