DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6672>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6672

SAXValidator results in an access violation when validating against schema with empty 
element that has default value

           Summary: SAXValidator results in an access violation when
                    validating against schema with empty element that has
                    default value
           Product: Xerces-C++
           Version: 1.6.0
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Validating Parser (Schema) (Xerces 1.5 or up only)
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


The following circumstance seems to result in an access violation:

* Use SAX2XMLReader (created by XMLReaderFactory::createXMLReader()) to parser 
an XML message.
* Schema Validation is turned on by setting the following features to true:
        http://xml.org/sax/features/validation
        http://apache.org/xml/features/validation/dynamic
        http://apache.org/xml/features/validation/schema
        http://apache.org/xml/features/validation/schema-full-checking
* A simple specialisation of DefaultHandler is set to the SAX2XMLReader as 
setErrorHandler and setContentHandler.
* Parse a XML message which contains an empty element (e.g. <MagTag/>).
* That empty element has a default value defined in the schema. And that 
element has valid range defined as an enumeration in the schema.
* The message was passed to the parser as a MemBufInputSource.

When it parses the XML message, it results in an access violation.

Looking into the code, the error was coming out from the function call int 
SchemaValidator::checkContent(...), at the following line of code (Line 272 
SchemaValidator.cpp of in Revision 1.26):

getScanner()->getDocHandler()->docCharacters(elemDefaultValue, 
XMLString::stringLen(elemDefaultValue), false);

The access violation was because getScanner()->getDocHandler() returns a null 
pointer.

I ran the program on Win2K using Visual C++ 6 to compile but I believe similar 
problem should appear in other platforms.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to