summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-04-04 12:31:04 +0100
committerAndras Timar <andras.timar@collabora.com>2017-04-07 07:53:05 +0200
commit8b4782a6ff19fb4cd5bf006c20cbec4c41fba69e (patch)
tree21c2786ff8b54c6755c315843da544e6aa6f754c /sw
parent89fc91553330c9b14f87032abd72fe4383f3da96 (diff)
ofz: guard against bogus sprm len
Change-Id: I9b4074e1024753549f468f427afbfdf9cd01b674 (cherry picked from commit d30fb62f4f1022ae6294e246974d0018596cf8ec) ofz: guard harder against bogus sprm len Change-Id: Ic82526e1454b24f094d3deee89647e88760bc44b (cherry picked from commit 924624b40a97d6925f66374259c2c21707805fcd) Reviewed-on: https://gerrit.libreoffice.org/36078 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit feecc82753c48b1c82df2315896b9996e33af2e2)
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/ww8scan.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index b2a1fe3d04ff..439acd15ecd0 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -4902,6 +4902,11 @@ void WW8PLCFMan::GetSprmStart( short nIdx, WW8PLCFManResult* pRes ) const
{
// Length of actual sprm
pRes->nMemLen = maSprmParser.GetSprmSize(pRes->nSprmId, pRes->pMemPos);
+ if (pRes->nMemLen > p->nSprmsLen)
+ {
+ SAL_WARN("sw.ww8", "Short sprm, len " << pRes->nMemLen << " claimed, max possible is " << p->nSprmsLen);
+ pRes->nSprmId = 0;
+ }
}
}