Uploaded image for project: 'Xerces2-J'
  1. Xerces2-J
  2. XERCESJ-1280

XML Schema: XPath parser gets stuck in infinite loop for some invalid XPath expressions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.9.1
    • 2.10.0
    • None

    Description

      Xerces' schema loader hangs in the XPath parser while attempting to process the following invalid schema:

      <?xml version="1.0" encoding="UTF-8"?>
      <schema xmlns="http://www.w3.org/2001/XMLSchema">
      <complexType name="NewComplexType">
      <sequence>
      <element name="NewElement" type="string">
      <key name="abc">
      <selector xpath="\"></selector>
      </key>
      </element>
      </sequence>
      </complexType>
      </schema>

      There's a large case block in the XPath scanner which is missing a "default:" which causes it to loop forever on the same character in the invalid expression without ever progressing to the next character in the string (or breaking out of the loop if it's at the end of the string).

      See https://bugs.eclipse.org/bugs/show_bug.cgi?id=209733 where this bug was first reported.

      Attachments

        Activity

          People

            mrglavas@ca.ibm.com Michael Glavassevich
            mrglavas@ca.ibm.com Michael Glavassevich
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: