sw/source/filter/ww8/ww8par3.cxx |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit ad44bb453177e16d07e37f40745154b571489ffe
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Wed Apr 24 11:59:56 2019 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Sat Apr 27 15:40:34 2019 +0200

    crashtesting: imported junk as form field text
    
    spec says "An unsigned integer that MUST be 0xFFFFFFFF" for version
    so at least insist on that
    
    Change-Id: I8c11659d86fe122b1c8f61b1bf99e7b4b53ff306
    Reviewed-on: https://gerrit.libreoffice.org/71236
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index 012755119be2..2eae61737df4 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -2140,13 +2140,17 @@ void WW8FormulaControl::FormulaRead(SwWw8ControlType 
nWhich,
     SvStream *pDataStream)
 {
     sal_uInt8 nField;
-    // nHeaderBype == version
-    sal_uInt32 nHeaderByte = 0;
 
     // The following is a FFData structure as described in
     // Microsoft's DOC specification (chapter 2.9.78)
-
-    pDataStream->ReadUInt32( nHeaderByte );
+    sal_uInt32 nVersion = 0;
+    pDataStream->ReadUInt32(nVersion);
+    // An unsigned integer that MUST be 0xFFFFFFFF
+    if (nVersion != 0xFFFFFFFF)
+    {
+        SAL_WARN("sw.ww8", "Parsing error: invalid header for FFData");
+        return; // bail out
+    }
 
     // might be better to read the bits as a 16 bit word
     // ( like it is in the spec. )
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to