This is an automated email from the ASF dual-hosted git repository.

ardovm pushed a commit to branch AOO41X
in repository https://gitbox.apache.org/repos/asf/openoffice.git


The following commit(s) were added to refs/heads/AOO41X by this push:
     new ebd576426e Fix crash in helpex in case of XML parsing errors
ebd576426e is described below

commit ebd576426eea30d34af09a3e6d123cefbc021d26
Author: Arrigo Marchiori <ard...@yahoo.it>
AuthorDate: Thu Feb 8 20:03:22 2024 +0100

    Fix crash in helpex in case of XML parsing errors
    
    (cherry picked from commit 7a8fdded60123facef5fa0fa12539725cd444123)
---
 main/l10ntools/source/helpmerge.cxx | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/main/l10ntools/source/helpmerge.cxx 
b/main/l10ntools/source/helpmerge.cxx
index 8341341aea..7f47d2a9c1 100644
--- a/main/l10ntools/source/helpmerge.cxx
+++ b/main/l10ntools/source/helpmerge.cxx
@@ -303,6 +303,11 @@ bool HelpParser::Merge( const ByteString &rSDFFile, const 
ByteString &rDestinati
     DirEntry aFile( sXmlFile );
  
        XMLFile* xmlfile = ( aParser.Execute( aFile.GetFull() , sOUHelpFile, 
new XMLFile( '0' ) ) );
+    if (xmlfile == NULL) {
+        printf("%s\n",ByteString(aParser.GetError().sMessage,
+                                 RTL_TEXTENCODING_ASCII_US).GetBuffer());
+        exit(-1);
+    }
        printf("Dest file %s\n",rDestinationFile.GetBuffer());
        hasNoError = MergeSingleFile( xmlfile , aMergeDataFile , sLanguage , 
rDestinationFile );
        delete xmlfile;
@@ -388,7 +393,6 @@ bool HelpParser::Merge(
     DirEntry aFile( sXmlFile );
 
        XMLFile* xmlfile = ( aParser.Execute( aFile.GetFull() , sOUHelpFile, 
new XMLFile( '0' ) ) );
-       xmlfile->Extract();
 
        if( xmlfile == NULL)
        {
@@ -396,6 +400,7 @@ bool HelpParser::Merge(
                exit(-1);
                //return false;
        }
+       xmlfile->Extract();
 
 
     ByteString sCur;

Reply via email to