Kaydet (Commit) 21f13f91 authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud

coverity#705976 coverity#7074977

Change-Id: Iaedb5fcd87a24f478d7c4a9c25e32cd2d0ee55da
Reviewed-on: https://gerrit.libreoffice.org/2221Reviewed-by: 's avatarNorbert Thiebaud <nthiebaud@gmail.com>
Tested-by: 's avatarNorbert Thiebaud <nthiebaud@gmail.com>
üst d1dc850c
...@@ -123,21 +123,6 @@ SAXHelper::SAXHelper( ) ...@@ -123,21 +123,6 @@ SAXHelper::SAXHelper( )
m_pParserCtxt = xmlNewParserCtxt() ; m_pParserCtxt = xmlNewParserCtxt() ;
/*
* i41748
*
* mmi : re-initialize the SAX handler to version 1
*/
xmlSAXVersion(m_pParserCtxt->sax, 1);
/* end */
if( m_pParserCtxt->inputTab[0] != NULL )
{
m_pParserCtxt->inputTab[0] = NULL ;
}
if( m_pParserCtxt == NULL ) if( m_pParserCtxt == NULL )
{ {
#ifndef XMLSEC_NO_XSLT #ifndef XMLSEC_NO_XSLT
...@@ -148,25 +133,35 @@ SAXHelper::SAXHelper( ) ...@@ -148,25 +133,35 @@ SAXHelper::SAXHelper( )
// xmlCleanupParser() ; // xmlCleanupParser() ;
throw cssu::RuntimeException() ; throw cssu::RuntimeException() ;
} }
else if( m_pParserCtxt->sax == NULL ) else
{ {
xmlFreeParserCtxt( m_pParserCtxt ) ; xmlSAXVersion(m_pParserCtxt->sax, 1);
if( m_pParserCtxt->inputTab[0] != NULL )
{
m_pParserCtxt->inputTab[0] = NULL ;
}
if( m_pParserCtxt->sax == NULL )
{
xmlFreeParserCtxt( m_pParserCtxt ) ;
#ifndef XMLSEC_NO_XSLT #ifndef XMLSEC_NO_XSLT
xsltCleanupGlobals() ; xsltCleanupGlobals() ;
#endif #endif
// see issue i74334, we cannot call xmlCleanupParser when libxml is still used // see issue i74334, we cannot call xmlCleanupParser when libxml is still used
// in other parts of the office. // in other parts of the office.
// xmlCleanupParser() ; // xmlCleanupParser() ;
m_pParserCtxt = NULL ; m_pParserCtxt = NULL ;
throw cssu::RuntimeException() ; throw cssu::RuntimeException() ;
} }
else else
{ {
m_pSaxHandler = m_pParserCtxt->sax ; m_pSaxHandler = m_pParserCtxt->sax ;
//Adjust the context //Adjust the context
m_pParserCtxt->recovery = 1 ; m_pParserCtxt->recovery = 1 ;
}
} }
} }
...@@ -233,6 +228,10 @@ xmlDocPtr SAXHelper::getDocument() ...@@ -233,6 +228,10 @@ xmlDocPtr SAXHelper::getDocument()
void SAXHelper::startDocument( void ) void SAXHelper::startDocument( void )
throw( cssxs::SAXException , cssu::RuntimeException ) throw( cssxs::SAXException , cssu::RuntimeException )
{ {
if( m_pParserCtxt == NULL)
{
throw cssu::RuntimeException() ;
}
/* /*
* Adjust inputTab * Adjust inputTab
*/ */
...@@ -246,7 +245,7 @@ void SAXHelper::startDocument( void ) ...@@ -246,7 +245,7 @@ void SAXHelper::startDocument( void )
m_pSaxHandler->startDocument( m_pParserCtxt ) ; m_pSaxHandler->startDocument( m_pParserCtxt ) ;
if( m_pParserCtxt == NULL || m_pParserCtxt->myDoc == NULL ) if( m_pParserCtxt->myDoc == NULL )
{ {
throw cssu::RuntimeException() ; throw cssu::RuntimeException() ;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment