From dd6ed5a9a7f415f72fb67005d5c7c982db3bc00f Mon Sep 17 00:00:00 2001 From: starocean999 <40539150+starocean999@users.noreply.github.com> Date: Sat, 24 Sep 2022 17:32:00 +0800 Subject: [PATCH] [fix](function)fix string split function buffer overflow (#12834) --- be/src/vec/functions/function_string.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/be/src/vec/functions/function_string.h b/be/src/vec/functions/function_string.h index 0bd1dac58f..c6294a08c4 100644 --- a/be/src/vec/functions/function_string.h +++ b/be/src/vec/functions/function_string.h @@ -1013,7 +1013,7 @@ public: int32_t num = 0; while (num < part_number) { pre_offset = offset; - size_t n = str.size - offset; + size_t n = str.size - offset - 1; const char* pos = reinterpret_cast( memchr(str.data + offset + 1, delimiter_str[0], n)); if (pos != nullptr) {