Skip to content

Commit

Permalink
also check pair size
Browse files Browse the repository at this point in the history
  • Loading branch information
pajlada committed May 16, 2020
1 parent 803f2a2 commit 53fe843
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions message.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,10 @@ func parseEmotes(rawEmotes, message string) []*Emote {
continue
}
pair := strings.SplitN(pairs[0], "-", 2)
if len(pair) != 2 {
// We have received bad emote data :(
continue
}

firstIndex, _ := strconv.Atoi(pair[0])
lastIndex, _ := strconv.Atoi(pair[1])
Expand Down

0 comments on commit 53fe843

Please sign in to comment.