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

Access violation during parsing with schema validation turned on if a needed schema is missing.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 2.5.0, 2.6.0
    • None
    • None
    • win2k on ix86.

    Description

      There is an access violation during parsing in some circumstances if schema validation is on
      and one of the schema needed to fully validate the document is missing.
      Attached is a reduced test case, in the form of a .xsd schema and a .xml document,
      which refers to that schema and to another, missing, schema.
      Running "DOMPrint.exe -n -s input.xml" will trigger the access violation.
      I could reproduce the bug in both xercesc-2.5 and 2.6, but not in xercesc-2.7.
      The call-stack is:
      xercesc_2_5::RefHashTableOf<xercesc_2_5::DTDAttDef>::findBucketElem(const void * const 0x04601f20, unsigned int & 302830086) line 527 + 3 bytes
      xercesc_2_5::RefHashTableOf<xercesc_2_5::DTDAttDef>::get(const void * const 0x04601f20) line 405 + 16 bytes
      xercesc_2_5::DTDElementDecl::getAttDef(const unsigned short * const 0x04601f20) line 297
      xercesc_2_5::IGXMLScanner::buildAttList(const xercesc_2_5::RefVectorOf<xercesc_2_5::KVStringPair> &

      {...}, const unsigned int 2, xercesc_2_5::XMLElementDecl * 0x04782738, xercesc_2_5::RefVectorOf<xercesc_2_5::XMLAttr> & {...}

      ) line 313 + 12 bytes
      xercesc_2_5::IGXMLScanner::scanStartTagNS(unsigned char & 1) line 2843 + 42 bytes
      xercesc_2_5::IGXMLScanner::scanContent() line 939
      xercesc_2_5::IGXMLScanner::scanDocument(const xercesc_2_5::InputSource &

      {...}) line 251 + 8 bytes
      xercesc_2_5::AbstractDOMParser::parse(const xercesc_2_5::InputSource & {...}

      ) line 461
      As one can see, a SchemaElementDecl* is wrongly cast to a DTDElementDecl*, hence the access violation!
      Best regards,
      Alain Le Guennec.

      Attachments

        1. input.xml
          0.4 kB
          Alain Le Guennec
        2. known.xsd
          0.7 kB
          Alain Le Guennec

        Issue Links

          Activity

            People

              Unassigned Unassigned
              aleguenn@free.fr Alain Le Guennec
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: