This is an automated email from the ASF dual-hosted git repository. yiguolei pushed a commit to branch branch-1.1-lts in repository https://gitbox.apache.org/repos/asf/doris.git
commit 25be8f7c5a3e36836fd01276b7f443d33f7d0ffc Author: Zhengguo Yang <[email protected]> AuthorDate: Thu Sep 15 08:43:10 2022 +0800 [Bugfix](string_functions) fix heap-buffer-overflow on find_in_set (#12613) --- be/src/exprs/string_functions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/be/src/exprs/string_functions.cpp b/be/src/exprs/string_functions.cpp index 825762ce9d..f2ccb577ae 100644 --- a/be/src/exprs/string_functions.cpp +++ b/be/src/exprs/string_functions.cpp @@ -700,7 +700,7 @@ IntVal StringFunctions::find_in_set(FunctionContext* context, const StringVal& s do { end = start; // Position end. - while (str_set.ptr[end] != ',' && end < str_set.len) { + while (end < str_set.len && str_set.ptr[end] != ',') { ++end; } StringValue token(reinterpret_cast<char*>(str_set.ptr) + start, end - start); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
