diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-11-02 19:44:56 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-11-02 22:04:56 +0100 |
commit | 4ba6d047e8199a97c9d3e93e5f4c179f9e3b0eb5 (patch) | |
tree | 32a804fee2f61ba1532e162e8474171b973d5ce1 | |
parent | 7f305223fa6d6a1ad4a6f906b14f879cb01539be (diff) |
ofz#18620 Timeout
Change-Id: Ifecba03620328afd20c80501aaacaf5795aee704
Reviewed-on: https://gerrit.libreoffice.org/81947
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sfx2/source/doc/oleprops.cxx | 12 |
1 files changed, 5 insertions, 7 deletions
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); |