[Bugfix](string_functions) fix heap-buffer-overflow on find_in_set (#12613)

This commit is contained in:
Zhengguo Yang
2022-09-15 08:43:10 +08:00
committed by GitHub
parent 47d43b34b3
commit d8b6f09cc1

View File

@ -710,7 +710,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);