Uploaded image for project: 'Xerces-C++'
  1. Xerces-C++
  2. XERCESC-1021

RegularExpression: wrong Match end for fixed string match

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.0
    • 3.1.0
    • Utilities
    • None
    • Operating System: All
      Platform: All
    • 23707

    Description

      RegularExpression::matches() calls context->fMatch->setEndPos()
      with the wrong value when doing a fFixedStringOnly match and not
      in XMLSCHEMA_MODE (i.e. a fixed string match using a Perl-like pattern).

      The problem is this line of code (line 546 of RegularExpression.cpp in
      the 2.3 src distro):
      context->fMatch->setEndPos(0, ret + strLength);

      strLength is the length of the "expression" parameter passed to matches().
      I believe the value really should be the length of fFixedString. As it
      currently exists, the call to setEndPos() generally sets a value that is
      beyond the end of "expression".

      This bug has no effect on XMLSCHEMA_MODE, which never uses this code.

      Attachments

        1. xercesbug.cpp
          1 kB
          Dave Cohrs

        Activity

          People

            amassari Alberto Massari
            cohrs@inviosoftware.com Dave Cohrs
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: