[BUG] Fixed the problem that substring function may access illegal address (#5952)
This commit is contained in:
@ -69,7 +69,7 @@ StringVal StringFunctions::substring(FunctionContext* context, const StringVal&
|
||||
if (str.is_null || pos.is_null || len.is_null || pos.val > str.len) {
|
||||
return StringVal::null();
|
||||
}
|
||||
if (len.val <= 0 || str.len == 0) {
|
||||
if (len.val <= 0 || str.len == 0 || pos.val == 0) {
|
||||
return StringVal();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user