[Libreoffice-commits] core.git: l10ntools/source
Douglas Mencken
dougmencken at gmail.com
Tue Sep 9 08:49:39 PDT 2014
l10ntools/source/export.cxx | 5 +++++
1 file changed, 5 insertions(+)
New commits:
commit 9e773854c8cd24e526a6beed6bee74313a7fd47b
Author: Douglas Mencken <dougmencken at gmail.com>
Date: Sun Sep 7 05:56:50 2014 -0400
l10ntools/source/export.cxx: add sanity check to aOutput.mSimple
Change-Id: I05074760f189dfc00ce14ec33002609a56797a6d
Reviewed-on: https://gerrit.libreoffice.org/11321
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx
index efd336d..49805cc 100644
--- a/l10ntools/source/export.cxx
+++ b/l10ntools/source/export.cxx
@@ -233,6 +233,11 @@ Export::Export(
{
aOutput.mSimple = new std::ofstream();
aOutput.mSimple->open(rOutput.getStr(), std::ios_base::out | std::ios_base::trunc);
+ if (!aOutput.mSimple->is_open())
+ {
+ std::fprintf(stderr, "ERROR : Can't open file %s\n", rOutput.getStr());
+ std::exit(EXIT_FAILURE);
+ }
if ( bUTF8BOM ) WriteUTF8ByteOrderMarkToOutput();
}
More information about the Libreoffice-commits
mailing list