[fdo-trac] #727: FdoXmlReaderXrcs::Parse will result in crash when XML is invalid.

FDO trac_fdo at osgeo.org
Wed Nov 24 01:22:20 EST 2010


#727: FdoXmlReaderXrcs::Parse will result in crash when XML is invalid.
----------------------------+-----------------------------------------------
   Reporter:  leaf          |       Owner:  gregboone
       Type:  defect        |      Status:  new      
   Priority:  major         |   Milestone:  3.6.0    
  Component:  WFS Provider  |     Version:  3.5.0    
   Severity:  3             |    Keywords:           
External_id:  1366350       |  
----------------------------+-----------------------------------------------
 trunk\Fdo\Unmanaged\Src\Common\Xml\ReaderXrcs.cpp

 FdoBoolean FdoXmlReaderXrcs::Parse(
     FdoXmlSaxHandler* saxHandler,
     FdoXmlSaxContext* saxContext,
     FdoBoolean incremental
 )
 {
     ......
     catch ( const XERCES_CPP_NAMESPACE::SAXParseException& ex ) {
         if ( saxHandler )
             PopSaxHandler();
         SetSaxContext(NULL);

         throw FdoXmlException::Create(
             FdoException::NLSGetMessage(
                 FDO_NLSID(FDO_33_XMLPARSEERROR),
                 ex.getLineNumber(),
                 ex.getColumnNumber(),
 (FdoString*)FdoXmlUtilXrcs::Xrcs2Unicode(ex.getMessage()));
     }
     ......
 }

 FDO_33_XMLPARSEERROR represents resource string "XML Document parse error
 at line %1$d column %2$d: %3$ls". Here it use "%d" to format line and
 column number with invalid XML. However, ex.getLineNumber() and
 ex.getColumnNumber() return int64 number. So it will result in crash when
 calling FdoException::NLSGetMessage.

-- 
Ticket URL: <http://trac.osgeo.org/fdo/ticket/727>
FDO <http://fdo.osgeo.org/>
Feature Data Objects


More information about the fdo-trac mailing list