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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • 16
    • 16
    • tools
    • b12

    Description

      --- 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..."

      Attachments

        Activity

          People

            prappo Pavel Rappo
            prappo Pavel Rappo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: