[Libreoffice-commits] core.git: sfx2/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Sat Nov 2 21:05:53 UTC 2019


 sfx2/source/doc/oleprops.cxx |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

New commits:
commit 4ba6d047e8199a97c9d3e93e5f4c179f9e3b0eb5
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Nov 2 19:44:56 2019 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Nov 2 22:04:56 2019 +0100

    ofz#18620 Timeout
    
    Change-Id: Ifecba03620328afd20c80501aaacaf5795aee704
    Reviewed-on: https://gerrit.libreoffice.org/81947
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sfx2/source/doc/oleprops.cxx b/sfx2/source/doc/oleprops.cxx
index 64acbcb9b27a..b1299b57b832 100644
--- a/sfx2/source/doc/oleprops.cxx
+++ b/sfx2/source/doc/oleprops.cxx
@@ -271,10 +271,8 @@ OUString SfxOleStringHelper::ImplLoadString8( SvStream& rStrm ) const
     sal_Int32 nSize(0);
     rStrm.ReadInt32( nSize );
     // size field includes trailing NUL character
-    DBG_ASSERT( (0 < nSize) && (nSize <= 0xFFFF),
-        OStringBuffer("SfxOleStringHelper::ImplLoadString8 - invalid string of len ").
-        append(nSize).getStr() );
-    if (nSize < 0 || nSize > 0xFFFF)
+    SAL_WARN_IF(nSize < 1 || nSize > 0xFFFF, "sfx.doc", "SfxOleStringHelper::ImplLoadString8 - invalid string of len " << nSize);
+    if (nSize < 1 || nSize > 0xFFFF)
         return OUString();
     // load character buffer
     OString sValue(read_uInt8s_ToOString(rStrm, nSize - 1));
@@ -287,10 +285,10 @@ OUString SfxOleStringHelper::ImplLoadString16( SvStream& rStrm )
 {
     // read size field (signed 32-bit), may be buffer size or character count
     sal_Int32 nSize(0);
-    rStrm.ReadInt32( nSize );
-    DBG_ASSERT( (0 < nSize) && (nSize <= 0xFFFF), "SfxOleStringHelper::ImplLoadString16 - invalid string" );
+    rStrm.ReadInt32(nSize);
+    SAL_WARN_IF(nSize < 1 || nSize > 0xFFFF, "sfx.doc", "SfxOleStringHelper::ImplLoadString16 - invalid string of len " << nSize);
     // size field includes trailing NUL character
-    if (nSize < 0 || nSize > 0xFFFF)
+    if (nSize < 1 || nSize > 0xFFFF)
         return OUString();
     // load character buffer
     OUString aValue = read_uInt16s_ToOUString(rStrm, nSize - 1);


More information about the Libreoffice-commits mailing list