Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8251357

[DocCommentParser] Infinite loop while looking for the end of a preamble

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 16
    • 16
    • tools
    • b12

      --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java
      +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/DocCommentParser.java
      @@ -707,14 +707,14 @@ public class DocCommentParser {
                           case "body":
                               // Check if also followed by <main>
                               // 1. skip rest of <body>
      - while (ch != -1 && ch != '>') {
      + while (bp < buflen && ch != '>') {
                                   nextChar();
                               }
                               if (ch == '>') {
                                   nextChar();
                               }
                               // 2. skip any whitespace
      - while (ch != -1 && Character.isWhitespace(ch)) {
      + while (bp < buflen && Character.isWhitespace(ch)) {
                                   nextChar();
                               }
                               // 3. check if looking at "<main..."

            prappo Pavel Rappo (Inactive)
            prappo Pavel Rappo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: