Uploaded image for project: 'JBoss Web'
  1. JBoss Web
  2. JBWEB-165

readLine in CoyoteReader can cause infinite loop reading strings longer than 4096 characters

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: JBossWeb-2.1.6.GA
    • Fix Version/s: JBossWeb-2.1.8.GA
    • Component/s: None
    • Labels:
      None
    • Environment:

      Ubuntu 2.6.31-14-generic-pae, Java 1.6.0_15, JBoss 5.1.0.GA

      Description

      If you post a request with a body containing a line longer than 4096 characters, and then try to read the string using readLine on the BufferedReader obtained from the HttpRequest (an instance of org.apache.catalina.connector.CoyoteReader), then you will enter an infinite loop.

      This appears to be cause by the change applied in revision 720.

      This changed line 159 as follows:

      159 if (nRead < 0) { if (nRead < 0 && aggregator == null) {
      160 if (pos == 0) { if (pos == 0)

      { 161 return null; return null; 162 } }


      I believe this should have been a modification to line 160, (as made in the apache repositories)

      159 if (nRead < 0) { if (nRead < 0) {
      160 if (pos == 0) { if (pos == 0 && aggregator == null) {161 return null; return null;162 }

      }

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                rmaucher Valued Customer
                Reporter:
                neades Neil Eades
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: