Skip to content

Commit

Permalink
fix bug:slice bounds out of range
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxinmiao committed Jun 3, 2021
1 parent 9e3e977 commit 16253e3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/aliyun/tool.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,9 @@ func SubString(str string , begin int ,length int) (substr string) {
if begin >= lth {
begin = lth
}
if length < 0 {
length = 0
}
end := begin + length
if end > lth {
end = lth
Expand Down

0 comments on commit 16253e3

Please sign in to comment.