Jettison
  1. Jettison
  2. JETTISON-74

End document event generated before matching end element when processing invalid JSON with BadgerFishXMLStreamReader

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.1
    • Fix Version/s: 1.3.2
    • Labels:
      None
    • Testcase included:
      yes
    • Patch Submitted:
      Yes
    • Number of attachments :
      1

      Description

      Let's take following JSON like string as an example. It is not valid BadgerFish JSON so we should get an error while processing it.

      "{ \"alice\":

      { \"foo\" : \"bob\" }

      }"

      This generates now events
      START_ELEMENT alice
      START_ELEMENT alice
      END_ELEMENT
      END_DOCUMENT

      If you have somewhere loop like
      while ( reader.next() != END_ELEMENT )
      you have potential infinite loop since start and end element events do not match. We fixed this by throwing an exception if the JSON object type is not what it is supposed to be according to Badgerfish format.

      Patch and test attached.

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Sergey Beryozkin
            Reporter:
            Mika Vesterholm
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: