summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-07-08 13:05:41 +0200
committerAndras Timar <andras.timar@collabora.com>2014-07-10 11:11:11 +0200
commit8325d47653063b64f09000d3fd6bea383e0c0e05 (patch)
treea2937c57bb2b39af15313dfbe48c69540104265e /sw
parent78ec69d2247dfdef9b5a5b94a76cfd1411c72b7f (diff)
sw: do more input validation in SwWW8ImplReader::Read_And
(to fix up f2945255df273404ee2457dcf761cb8f334b732b) Change-Id: Ie20fb9db4515b9737322ec7224ecd7e411d31c03 (cherry picked from commit ae2e7ad276acb9394691a9d4a702ed7a6b07b508) Reviewed-on: https://gerrit.libreoffice.org/10141 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
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 96b62213dec6..3755c8ff9989 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2184,7 +2184,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)
{