[Libreoffice-commits] .: xmloff/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Jan 2 17:19:01 PST 2013
xmloff/source/style/xmlnumfi.cxx | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
New commits:
commit 5693934456f917861af7cb02734578b049a46940
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Thu Jan 3 02:18:25 2013 +0100
limit the number of imported digits, fdo#58539
This should fix the crash with gnome#627420.
Change-Id: Ibfff498282dc1c6fe9124ced645392107ef8829f
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index 7b0799c..8b57734 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 ))
More information about the Libreoffice-commits
mailing list