summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-10-19 19:16:10 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-10-20 15:35:57 +0200
commit86550dd734c4ca05ccb8af667bbcb0058d3eb7b4 (patch)
tree26d3ec6d2d90ccd76dfcf99071714730f36ab4c9
parenta14da9c96d8acca989175d94186037c31c84608b (diff)
cid#1608476 Overflowed constant
just set nRead to an initial 2 and leave nLen2 alone, nRead and nLen2 are only used for the loop condition Change-Id: I269db2d986070f010a05eb58f200d19afc1bff1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175241 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
-rw-r--r--sw/source/filter/ww8/ww8scan.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 2efeb1c1a49b..97af529488c7 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -4227,8 +4227,8 @@ void WW8ReadSTTBF(bool bVer8, SvStream& rStrm, sal_uInt32 nStart, sal_Int32 nLen
nLen = 2;
nLen2 = o3tl::narrowing<sal_uInt16>(nLen);
}
- sal_uLong nRead = 0;
- for( nLen2 -= 2; nRead < nLen2; )
+ sal_uLong nRead = 2;
+ while (nRead < nLen2)
{
sal_uInt8 nBChar(0);
rStrm.ReadUChar( nBChar );