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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 16
    • Fix Version/s: 16
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      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

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

              Dates

              Created:
              Updated:
              Resolved: