summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-10-24 12:31:20 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-10-25 09:58:59 +0200
commit00b28ffe72284464c99e30a4bfb163f475f248b1 (patch)
tree78d5e719d77050f0815c0f68ee9d3fe52d414f25 /sw
parentf519a99c76ef1f34f2b2d54e1c276326960fdf78 (diff)
ofz#3765 Integer-overflow
Change-Id: Ifff9cf1d094db1abe5236be41a5e769f8113aec1 Reviewed-on: https://gerrit.libreoffice.org/43763 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/ww8par.cxx5
1 files changed, 4 insertions, 1 deletions
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
}
}