sw/source/filter/ww8/ww8scan.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit feecc82753c48b1c82df2315896b9996e33af2e2
Author: Caolán McNamara <caol...@redhat.com>
Date:   Tue Apr 4 12:31:04 2017 +0100

    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 <c...@libreoffice.org>
    Reviewed-by: Michael Stahl <mst...@redhat.com>

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;
+        }
     }
 }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to