summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
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