changeset 73:1687f5192ce7

6845701: Xerces2 Java XML library infinite loop with malformed XML input Reviewed-by: hawtin
author asaha
date Mon, 22 Jun 2009 13:56:30 -0700
parents 97344798aaf7
children 1b3c6eec7d31
files src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLScanner.java
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLScanner.java	Thu Jun 11 21:26:25 2009 -0700
+++ b/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);