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

Caolán McNamara caolanm at redhat.com
Wed Oct 25 07:59:20 UTC 2017


 sw/source/filter/ww8/ww8par.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 00b28ffe72284464c99e30a4bfb163f475f248b1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Oct 24 12:31:20 2017 +0100

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

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 0dcf361b8445..996419b84712 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -4116,7 +4116,10 @@ bool SwWW8ImplReader::ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType)
             // Call all 64 CRs; not for Header and the like
             if ((nCrCount++ & 0x40) == 0 && nType == MAN_MAINTEXT)
             {
-                m_nProgress = (sal_uInt16)( l * 100 / nTextLen );
+                if (nTextLen < WW8_CP_MAX/100)
+                    m_nProgress = (sal_uInt16)(l * 100 / nTextLen);
+                else
+                    m_nProgress = (sal_uInt16)(l / nTextLen * 100);
                 m_xProgress->Update(m_nProgress); // Update
             }
         }


More information about the Libreoffice-commits mailing list