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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 6
    • 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.

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

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: