diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-08-21 13:45:13 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-08-21 13:45:16 +0100 |
commit | e0ad897e40e57ab81fc0a18e8f907594f17b7430 (patch) | |
tree | 2ead00da9c2d6c98e0707936c527cef1891018d8 /sw | |
parent | 0030efe09ad9447933ac3b1875c270ed1649aee7 (diff) |
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
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/core/data/ww6/pass/crash-5.doc | bin | 0 -> 6647 bytes | |||
-rw-r--r-- | sw/source/filter/ww8/ww8scan.cxx | 6 |
2 files changed, 3 insertions, 3 deletions
diff --git a/sw/qa/core/data/ww6/pass/crash-5.doc b/sw/qa/core/data/ww6/pass/crash-5.doc Binary files differnew file mode 100644 index 000000000000..f1f4d7808c78 --- /dev/null +++ b/sw/qa/core/data/ww6/pass/crash-5.doc diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index bb5552a0aeea..aaa0239fd5f2 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); |