[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - lotuswordpro/source

Caolán McNamara caolanm at redhat.com
Mon Mar 6 14:30:07 UTC 2017


 lotuswordpro/source/filter/tocread.cxx |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit ad2748559c15d3eaa7e8be1506e3474002d4ef5b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Mar 4 21:20:48 2017 +0000

    fail on unknown version flags
    
    Change-Id: Icbd2608a3341652b1b40f6bdebb66c4caf6e810a
    Reviewed-on: https://gerrit.libreoffice.org/34895
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/lotuswordpro/source/filter/tocread.cxx b/lotuswordpro/source/filter/tocread.cxx
index 192a636..73f9ccb 100644
--- a/lotuswordpro/source/filter/tocread.cxx
+++ b/lotuswordpro/source/filter/tocread.cxx
@@ -109,13 +109,12 @@ CBenTOCReader::ReadLabel(unsigned long * pTOCOffset, unsigned long * pTOCSize)
 
     BenByte * pCurrLabel = Label + BEN_MAGIC_BYTES_SIZE;
 
-#ifndef NDEBUG
     BenWord Flags =
-#endif
         UtGetIntelWord(pCurrLabel); pCurrLabel += 2; // Flags
     // Newer files are 0x0101--indicates if big or little endian.  Older
     // files are 0x0 for flags
-    assert(Flags == 0x0101 || Flags == 0x0);
+    if (Flags != 0x0101 && Flags != 0x0)
+        return BenErr_UnknownBentoFormatVersion;
 
     cBlockSize = UtGetIntelWord(pCurrLabel) * 1024; pCurrLabel += 2;
     if (cBlockSize == 0)


More information about the Libreoffice-commits mailing list