Skip to content

Commit 61325c3

Browse files
Fix AMBIGUOUS_AMPERSAND state
1 parent a3d911d commit 61325c3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/nu/validator/htmlparser/impl/Tokenizer.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -3546,13 +3546,14 @@ private void ensureBufferSpace(int inputLength) throws SAXException {
35463546
} else if ((c >= '0' && c <= '9')
35473547
|| (c >= 'A' && c <= 'Z')
35483548
|| (c >= 'a' && c <= 'z')) {
3549+
if (++pos == endPos) {
3550+
break stateloop;
3551+
}
3552+
appendCharRefBuf(c);
35493553
emitOrAppendCharRefBuf(returnState);
35503554
if ((returnState & DATA_AND_RCDATA_MASK) == 0) {
35513555
cstart = pos;
35523556
}
3553-
if (++pos == endPos) {
3554-
break stateloop;
3555-
}
35563557
c = checkChar(buf, pos);
35573558
continue;
35583559
}

0 commit comments

Comments
 (0)