summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index b5cc9a846a82..542afa90ddd9 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -4265,8 +4265,15 @@ void WW8RStyle::ImportOldFormatStyles()
}
std::vector<pxoffset> aPAPXOffsets(stcp);
+ size_t nMaxByteCount = rSt.remainingSize();
sal_uInt16 cbPapx(0);
- rSt.ReadUInt16( cbPapx );
+ rSt.ReadUInt16(cbPapx);
+ if (cbPapx > nMaxByteCount)
+ {
+ SAL_WARN("sw.ww8", "WW8RStyle::ImportOldFormatStyles: truncating out of range "
+ << cbPapx << " to " << nMaxByteCount);
+ cbPapx = nMaxByteCount;
+ }
nByteCount = 2;
stcp=0;
while (nByteCount < cbPapx)