Skip to content

Commit

Permalink
handle malformed array argument (#4812)
Browse files Browse the repository at this point in the history
  • Loading branch information
slntopp authored Nov 5, 2024
1 parent a01db92 commit ea137ed
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions llx/builtin_simple.go
Original file line number Diff line number Diff line change
Expand Up @@ -2244,8 +2244,12 @@ func stringInArray(e *blockExecutor, bind *RawData, chunk *Chunk, ref uint64) (*

arr := arg.Value.([]interface{})
for i := range arr {
v := arr[i].(string)
if bind.Value.(string) == v {
v, ok := arr[i].(string)
if !ok {
return nil, 0, errors.New("invalid type in array")
}

if v == bind.Value.(string) {
return BoolTrue, 0, nil
}
}
Expand Down

0 comments on commit ea137ed

Please sign in to comment.