[Libreoffice-commits] core.git: sw/qa sw/source

Caolán McNamara caolanm at redhat.com
Fri Aug 21 05:48:01 PDT 2015


 sw/qa/core/data/ww6/pass/crash-5.doc |binary
 sw/source/filter/ww8/ww8scan.cxx     |    6 +++---
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit e0ad897e40e57ab81fc0a18e8f907594f17b7430
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Aug 21 13:45:13 2015 +0100

    afl-clang-fast++ seems to miscompile this
    
    doesn't harm to swap the order of comparisons, and include the failing testcase
    for reference
    
    Change-Id: I38399cca8f6085704ee714faa04fbbf283138c3d

diff --git a/sw/qa/core/data/ww6/pass/crash-5.doc b/sw/qa/core/data/ww6/pass/crash-5.doc
new file mode 100644
index 0000000..f1f4d78
Binary files /dev/null and b/sw/qa/core/data/ww6/pass/crash-5.doc differ
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index bb5552a..aaa0239 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -1901,12 +1901,12 @@ sal_Int32 WW8ScannerBase::WW8ReadString( SvStream& rStrm, OUString& rStr,
         long nLen = ( (nNextPieceCp < nBehindTextCp) ? nNextPieceCp
             : nBehindTextCp ) - nAktStartCp;
 
-        if( 0 >= nLen )
-            break;
-
         if( nLen > USHRT_MAX - 1 )
             nLen = USHRT_MAX - 1;
 
+        if( 0 >= nLen )
+            break;
+
         rStr += bIsUnicode
              ? read_uInt16s_ToOUString(rStrm, nLen)
              : read_uInt8s_ToOUString(rStrm, nLen, eEnc);


More information about the Libreoffice-commits mailing list