summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-01-03 02:18:25 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-01-03 14:08:22 +0100
commitf373868e16a1d83ceda531e4965cb00eaa523b8a (patch)
tree551647b4a9aa1a5b48cc727f4b949ebce5f310b1 /xmloff
parent74de75156f1ac6de427b62f000c6dcd248f914f6 (diff)
limit the number of imported digits, fdo#58539
This should fix the crash with gnome#627420. Change-Id: Ibfff498282dc1c6fe9124ced645392107ef8829f
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/style/xmlnumfi.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index 28a4ec62b4a7..1ffae17d043e 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -916,6 +916,8 @@ static void lcl_EnquoteIfNecessary( rtl::OUStringBuffer& rContent, const SvXMLNu
// SvXMLNumFmtElementContext
//
+const sal_Int32 MAX_SECOND_DIGITS = 20; // fdo#58539 & gnome#627420: limit number of digits during import
+
SvXMLNumFmtElementContext::SvXMLNumFmtElementContext( SvXMLImport& rImport,
sal_uInt16 nPrfx, const rtl::OUString& rLName,
SvXMLNumFormatContext& rParentContext, sal_uInt16 nNewType,
@@ -948,7 +950,7 @@ SvXMLNumFmtElementContext::SvXMLNumFmtElementContext( SvXMLImport& rImport,
{
case XML_TOK_ELEM_ATTR_DECIMAL_PLACES:
if (::sax::Converter::convertNumber( nAttrVal, sValue, 0 ))
- aNumInfo.nDecimals = nAttrVal;
+ aNumInfo.nDecimals = std::min<sal_Int32>(nAttrVal, MAX_SECOND_DIGITS);
break;
case XML_TOK_ELEM_ATTR_MIN_INTEGER_DIGITS:
if (::sax::Converter::convertNumber( nAttrVal, sValue, 0 ))