summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-03-23 15:24:35 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-03-23 20:12:24 +0100
commit44c63c0ba1eb491a9a2d8842badd1a5fc49376fd (patch)
treeaa5ed4fdd8c88ab84df93125a5006912b8f42a63 /sw
parent5db1e20b8b0942dac2d50f3cd34532bb61147020 (diff)
ofz#13881 Integer OverfloW
Change-Id: I90dc8be47cff080bc4e8242c2ae0961c2bc92aba Reviewed-on: https://gerrit.libreoffice.org/69588 Tested-by: Jenkins 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.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index c2708708bd41..c2a43bab3d5e 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -2021,7 +2021,11 @@ static bool WW8GetFieldPara(WW8PLCFspecial& rPLCF, WW8FieldDesc& rF)
goto Err;
}
rF.nLRes -= rF.nSRes; // now: nLRes = length
- rF.nSRes++; // Endpos including Markers
+ if (o3tl::checked_add<WW8_CP>(rF.nSRes, 1, rF.nSRes)) // Endpos including Markers
+ {
+ rF.nLen = 0;
+ goto Err;
+ }
rF.nLRes--;
}else{
rF.nLRes = 0; // no result found