[Libreoffice-commits] core.git: sw/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Mon Sep 6 11:40:43 UTC 2021
sw/source/filter/ww8/ww8par2.cxx | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
New commits:
commit a2e64311da811d40c3d0dba578cd5395b8a628e2
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Sep 6 10:18:12 2021 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Sep 6 13:40:10 2021 +0200
ofz: MemorySanitizer: use-of-uninitialized-value
Change-Id: Iaa51ef9f7d00de241f4d0e0564c90d6d11cc2f9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121713
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index a431040a20c7..297eb8453063 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -4169,6 +4169,9 @@ Word2CHPX ReadWord2Chpx(SvStream &rSt, std::size_t nOffset, sal_uInt8 nSize)
rSt.ReadUChar( nFlags8 );
nCount++;
+ if (!rSt.good())
+ break;
+
aChpx.fBold = nFlags8 & 0x01;
aChpx.fItalic = (nFlags8 & 0x02) >> 1;
aChpx.fRMarkDel = (nFlags8 & 0x04) >> 2;
@@ -4182,6 +4185,9 @@ Word2CHPX ReadWord2Chpx(SvStream &rSt, std::size_t nOffset, sal_uInt8 nSize)
rSt.ReadUChar( nFlags8 );
nCount++;
+ if (!rSt.good())
+ break;
+
aChpx.fRMark = nFlags8 & 0x01;
aChpx.fSpec = (nFlags8 & 0x02) >> 1;
aChpx.fStrike = (nFlags8 & 0x04) >> 2;
@@ -4195,6 +4201,9 @@ Word2CHPX ReadWord2Chpx(SvStream &rSt, std::size_t nOffset, sal_uInt8 nSize)
rSt.ReadUChar( nFlags8 );
nCount++;
+ if (!rSt.good())
+ break;
+
aChpx.fsIco = nFlags8 & 0x01;
aChpx.fsFtc = (nFlags8 & 0x02) >> 1;
aChpx.fsHps = (nFlags8 & 0x04) >> 2;
@@ -4208,6 +4217,9 @@ Word2CHPX ReadWord2Chpx(SvStream &rSt, std::size_t nOffset, sal_uInt8 nSize)
rSt.ReadUChar( nFlags8 );
nCount++;
+ if (!rSt.good())
+ break;
+
aChpx.fsFtcBi = nFlags8 & 0x01;
aChpx.fsHpsBi = (nFlags8 & 0x02) >> 1;
aChpx.fsLidBi = (nFlags8 & 0x04) >> 2;
@@ -4224,6 +4236,9 @@ Word2CHPX ReadWord2Chpx(SvStream &rSt, std::size_t nOffset, sal_uInt8 nSize)
rSt.ReadUChar( nFlags8 );
nCount++;
+ if (!rSt.good())
+ break;
+
aChpx.qpsSpace = nFlags8 & 0x3F;
aChpx.fSysVanish = (nFlags8 & 0x40) >> 6;
aChpx.fNumRun = (nFlags8 & 0x80) >> 7;
@@ -4232,6 +4247,9 @@ Word2CHPX ReadWord2Chpx(SvStream &rSt, std::size_t nOffset, sal_uInt8 nSize)
rSt.ReadUChar( nFlags8 );
nCount++;
+ if (!rSt.good())
+ break;
+
aChpx.ico = nFlags8 & 0x1F;
aChpx.kul = (nFlags8 & 0xE0) >> 5;
More information about the Libreoffice-commits
mailing list