Skip to content

Commit

Permalink
fix: bail out of readUnclosedTag early
Browse files Browse the repository at this point in the history
  • Loading branch information
natemoo-re committed Dec 21, 2023
1 parent 2172199 commit 091e365
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions internal/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -1251,10 +1251,11 @@ func (z *Tokenizer) readUnclosedTag() bool {
if close != -1 && len(buf) < close {
buf = buf[0:close]
}
}
close = bytes.Index(buf, []byte{'>'})
if close != -1 && len(buf) < close {
buf = buf[0:close]
} else {
close = bytes.Index(buf, []byte{'>'})
if close != -1 && len(buf) < close {
buf = buf[0:close]
}
}
if close == -1 {
// We can't find a closing tag...
Expand Down

0 comments on commit 091e365

Please sign in to comment.