Skip to content

Commit 2cd3a13

Browse files
committed
fix buffer handling
1 parent 0495cad commit 2cd3a13

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

src/main/java/org/htmlunit/cyberneko/HTMLScanner.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2903,17 +2903,14 @@ protected boolean scanAttribute(final XMLAttributesImpl attributes, final boolea
29032903
return false;
29042904
}
29052905
if (c == '/') {
2906-
if (fCurrentEntity.offset_ == fCurrentEntity.length_) {
2907-
if (fCurrentEntity.load(0) == -1) {
2908-
throw new EOFException();
2906+
if (fCurrentEntity.hasNext()) {
2907+
c = fCurrentEntity.getNextChar();
2908+
if (c == '>') {
2909+
empty[0] = true;
2910+
return false;
29092911
}
2912+
fCurrentEntity.rewind();
29102913
}
2911-
c = fCurrentEntity.getNextChar();
2912-
if (c == '>') {
2913-
empty[0] = true;
2914-
return false;
2915-
}
2916-
fCurrentEntity.rewind();
29172914
}
29182915

29192916
// https://html.spec.whatwg.org/multipage/parsing.html#parse-error-unexpected-character-in-attribute-name

0 commit comments

Comments
 (0)