sjsxp issue 40: XMLEventReader.getElementText() leads to infinite loop if there's a peeked event

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 1.4.0
    • Affects Version/s: 6
    • Component/s: xml
    • 1.4
    • generic
    • generic
    • Verified

        sjsxp issue 40:

        As per StaxTest org.codehaus.stax.test.evt.TestEventReader#testElementText, one
        hits an OutOfMemoryError (due to an infinite loop), if:

        (a) Event reader has a peeked event, and
        (b) XMLEventReader.getElementText() is called

        This is because in XMLEventReaderImpl, there's just:

                    while(event.getEventType() != XMLEvent.END_ELEMENT){

        (~ line 175), but nothing to fetch actual next event. Thus, the same (peeked)
        event is used over and over again (contents appended to string buffer),
        eventually running out of memory.

              Assignee:
              Joe Wang
              Reporter:
              Joe Wang
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: