6845701: Xerces2 Java XML library infinite loop with malformed XML input
authorasaha
Mon, 22 Jun 2009 13:56:30 -0700
changeset 3518 c4483e76656e
parent 2967 faa3111c009c
child 3519 75fcf3cd3bad
6845701: Xerces2 Java XML library infinite loop with malformed XML input Reviewed-by: hawtin
jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLScanner.java
--- a/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLScanner.java	Thu Jun 11 21:26:25 2009 -0700
+++ b/jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLScanner.java	Mon Jun 22 13:56:30 2009 -0700
@@ -1027,6 +1027,9 @@
                     int c = fEntityScanner.peekChar();
                     if (XMLChar.isMarkup(c) || c == ']') {
                         fStringBuffer.append((char)fEntityScanner.scanChar());
+                    } else if (c != -1 && isInvalidLiteral(c)) {
+                        reportFatalError("InvalidCharInSystemID",
+                            new Object[] {Integer.toString(c, 16)});
                     }
                 } while (fEntityScanner.scanLiteral(quote, ident) != quote);
                 fStringBuffer.append(ident);