summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-07-08 13:05:41 +0200
committerMichael Stahl <mstahl@redhat.com>2014-07-08 13:26:34 +0200
commitae2e7ad276acb9394691a9d4a702ed7a6b07b508 (patch)
tree1b274a40ce1e00909974b21253b89398094bcf53 /sw
parent902b7e9f192fab45cffc35d81cd0df0373a610ed (diff)
sw: do more input validation in SwWW8ImplReader::Read_And
(to fix up f2945255df273404ee2457dcf761cb8f334b732b) Change-Id: Ie20fb9db4515b9737322ec7224ecd7e411d31c03
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/ww8par.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 8289820c987f..9408e2cce226 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2180,7 +2180,9 @@ long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes)
//that relate to each annotation index as the parser passes
//those points.
sal_Int32 nLen = nEnd - nStart;
- if( nLen )
+ // the start and end positions are apparently stored in
+ // different arrays, so in an invalid file only one could exist
+ if(SAL_MAX_INT32 != nEnd && SAL_MAX_INT32 != nStart && nLen > 0)
{
if (pPaM->GetPoint()->nContent.GetIndex() >= nLen)
{