[Libreoffice-commits] core.git: sw/source

Caolán McNamara caolanm at redhat.com
Fri Nov 3 19:47:20 UTC 2017


 sw/source/filter/xml/xmlmeta.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 7cca1dc560aeceb430ef6a0db2f7823e717ee585
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Nov 3 13:58:52 2017 +0000

    ofz#4042 Integer-overflow
    
    Change-Id: Iccd150e8d704e065b8a3e060a1c9a2b6310e3641
    Reviewed-on: https://gerrit.libreoffice.org/44265
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/filter/xml/xmlmeta.cxx b/sw/source/filter/xml/xmlmeta.cxx
index 0d75cfc9b606..b4d5d8189b9d 100644
--- a/sw/source/filter/xml/xmlmeta.cxx
+++ b/sw/source/filter/xml/xmlmeta.cxx
@@ -23,6 +23,7 @@
 #include <xmloff/xmlmetai.hxx>
 #include <xmloff/xmlmetae.hxx>
 #include <editeng/langitem.hxx>
+#include <o3tl/safeint.hxx>
 #include <xmloff/xmluconv.hxx>
 #include <xmloff/nmspmap.hxx>
 #include <docstat.hxx>
@@ -148,7 +149,7 @@ void SwXMLImport::SetStatistics(
     if( nTokens & XML_TOK_META_STAT_PARA )
         nProgressReference = (sal_Int32)aDocStat.nPara;
     else if ( nTokens & XML_TOK_META_STAT_PAGE )
-        nProgressReference = 10 * (sal_Int32)aDocStat.nPage;
+        o3tl::checked_multiply<sal_Int32>(aDocStat.nPage, 10, nProgressReference);
     ProgressBarHelper* pProgress = GetProgressBarHelper();
     pProgress->SetReference( nProgressReference + 3*PROGRESS_BAR_STEP );
     pProgress->SetValue( 0 );


More information about the Libreoffice-commits mailing list