Uploaded image for project: 'Axis2-C'
  1. Axis2-C
  2. AXIS2C-933

guththila parser does not handle incomplete messages well, leading to an infinite loop or seg fault

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.0
    • Component/s: guththila
    • Labels:
      None
    • Environment:
      Windows XP, Visual Studio 2005, guththila, libcurl

      Description

      The code in the guththila parser has a couple of problems when the first allocated buffer fills up and it attempts to read more data. First, when allocating another buffer it doubled the size of all the buffers allocated to this point, but then recorded the new buffer size as only equal to the size of all the previous buffers. Second, after fixing the buffer allocation issue, I discovered that the read into the buffer tried to read as much as all the buffers to date, instead of just the amount remaining in the buffer just allocated. There is also a subtle problem in the guththila_next_no_char routine if last_start is not set, that it did not assure that all the characters since next are moved to the newly allocated buffer.

      While debugging this, because of other issues, I walked through the path of an unexpected EOF in the middle of the incoming message, and discovered that several while loops in the parser do not stop on EOF, but just keep reading and reading and reading...

        Attachments

        1. guththila_xml_parser.diff
          10 kB
          Bill Mitchell
        2. diff2.txt
          25 kB
          Bill Mitchell
        3. diff.txt
          16 kB
          Bill Mitchell

          Activity

            People

            • Assignee:
              wtmitchell3 Bill Mitchell
              Reporter:
              wtmitchell3 Bill Mitchell
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: