diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-10-26 09:42:48 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-10-27 09:56:29 +0200 |
commit | c15ac2c2ce71e35fd026109231444f5fb5745851 (patch) | |
tree | 67b3604df31457176c3affedfe6091d9396cb554 /sw | |
parent | 85b698cbd3de7ffd3c69309d452c1bf93156b75c (diff) |
ofz#3813 Integer-overflow
Change-Id: Ibc14583137aae0d46e501927e602a510339abe38
Reviewed-on: https://gerrit.libreoffice.org/43872
Tested-by: Jenkins <ci@libreoffice.org>
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/ww8scan.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index f296eb91af04..5e6fa76aa4d0 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -7294,7 +7294,14 @@ bool WW8PLCF_HdFt::GetTextPos(sal_uInt8 grpfIhdt, sal_uInt8 nWhich, WW8_CP& rSta SAL_WARN("sw.ww8", "End " << nEnd << " before Start " << rStart); return false; } - rLen = nEnd - rStart; + + bool bFail = o3tl::checked_sub(nEnd, rStart, rLen); + if (bFail) + { + SAL_WARN("sw.ww8", "broken offset, ignoring"); + return false; + } + aPLCF.advance(); return true; |