This is an automated email from the ASF dual-hosted git repository.
ardovm pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/AOO42X by this push:
new 5f9494a79d Fix crash in helpex in case of XML parsing errors
5f9494a79d is described below
commit 5f9494a79dfb6f0350588d850be06d137f8c033a
Author: Arrigo Marchiori <[email protected]>
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;