[Libreoffice-commits] core.git: sw/source
Caolán McNamara
caolanm at redhat.com
Thu Oct 19 14:00:59 UTC 2017
sw/source/filter/ww8/ww8scan.cxx | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
New commits:
commit 989f3a031235faa0356dddc9c29b0b23947447c5
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Oct 19 11:18:21 2017 +0100
ofz+ubsan: signed integer overflow
Change-Id: Ie75f4ff4c0efe1a1fb67b8d2edf86af9a962110f
Reviewed-on: https://gerrit.libreoffice.org/43543
Tested-by: Jenkins <ci at libreoffice.org>
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/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 44451b82a357..61d4ff7b2908 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -2062,9 +2062,13 @@ bool WW8PLCFspecial::GetData(long nInIdx, WW8_CP& rPos, void*& rpValue) const
WW8PLCF::WW8PLCF(SvStream& rSt, WW8_FC nFilePos, sal_Int32 nPLCF, int nStruct,
WW8_CP nStartPos) : pPLCF_PosArray(nullptr), nIdx(0), nStru(nStruct)
{
- OSL_ENSURE( nPLCF, "WW8PLCF: nPLCF is zero!" );
-
- nIMax = ( nPLCF - 4 ) / ( 4 + nStruct );
+ if (nPLCF < 0)
+ {
+ SAL_WARN("sw.ww8", "broken WW8PLCF, ignoring");
+ nPLCF = 0;
+ }
+ else
+ nIMax = (nPLCF - 4) / (4 + nStruct);
ReadPLCF(rSt, nFilePos, nPLCF);
More information about the Libreoffice-commits
mailing list