Kaydet (Commit) 56939344 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

limit the number of imported digits, fdo#58539

This should fix the crash with gnome#627420.

Change-Id: Ibfff498282dc1c6fe9124ced645392107ef8829f
üst 96e7e356
...@@ -916,6 +916,8 @@ static void lcl_EnquoteIfNecessary( rtl::OUStringBuffer& rContent, const SvXMLNu ...@@ -916,6 +916,8 @@ static void lcl_EnquoteIfNecessary( rtl::OUStringBuffer& rContent, const SvXMLNu
// SvXMLNumFmtElementContext // SvXMLNumFmtElementContext
// //
const sal_Int32 MAX_SECOND_DIGITS = 20; // fdo#58539 & gnome#627420: limit number of digits during import
SvXMLNumFmtElementContext::SvXMLNumFmtElementContext( SvXMLImport& rImport, SvXMLNumFmtElementContext::SvXMLNumFmtElementContext( SvXMLImport& rImport,
sal_uInt16 nPrfx, const rtl::OUString& rLName, sal_uInt16 nPrfx, const rtl::OUString& rLName,
SvXMLNumFormatContext& rParentContext, sal_uInt16 nNewType, SvXMLNumFormatContext& rParentContext, sal_uInt16 nNewType,
...@@ -948,7 +950,7 @@ SvXMLNumFmtElementContext::SvXMLNumFmtElementContext( SvXMLImport& rImport, ...@@ -948,7 +950,7 @@ SvXMLNumFmtElementContext::SvXMLNumFmtElementContext( SvXMLImport& rImport,
{ {
case XML_TOK_ELEM_ATTR_DECIMAL_PLACES: case XML_TOK_ELEM_ATTR_DECIMAL_PLACES:
if (::sax::Converter::convertNumber( nAttrVal, sValue, 0 )) if (::sax::Converter::convertNumber( nAttrVal, sValue, 0 ))
aNumInfo.nDecimals = nAttrVal; aNumInfo.nDecimals = std::min<sal_Int32>(nAttrVal, MAX_SECOND_DIGITS);
break; break;
case XML_TOK_ELEM_ATTR_MIN_INTEGER_DIGITS: case XML_TOK_ELEM_ATTR_MIN_INTEGER_DIGITS:
if (::sax::Converter::convertNumber( nAttrVal, sValue, 0 )) if (::sax::Converter::convertNumber( nAttrVal, sValue, 0 ))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment