Skip to content

Commit

Permalink
Add check to handle runtime error index out of bound
Browse files Browse the repository at this point in the history
Signed-off-by: Noble Mittal <[email protected]>
  • Loading branch information
beingnoble03 committed Jan 19, 2024
1 parent 515c8c4 commit 715da52
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions go/mysql/fastparse/fastparse.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ func ParseInt64(s string, base int) (int64, error) {
i++
}

if i >= uint(len(s)) {
return 0, fmt.Errorf("cannot parse int64 from %q", s)
}
minus := s[i] == '-'
if minus {
i++
Expand Down

0 comments on commit 715da52

Please sign in to comment.