diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-11-11 16:30:04 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-11-11 20:26:23 +0100 |
commit | 331b9aabb2ce91171bd0256f9e9f22761537dd9f (patch) | |
tree | 34ce6f165ac971927305051be9a2991fd95c64d6 /sc | |
parent | b926497227b0fdb3214df10d0bf9a07b0ae9a295 (diff) |
ofz: wkzfuzzer Timeout
Change-Id: I2e238c2f5dfbb1294049b3b089699deab957be38
Reviewed-on: https://gerrit.libreoffice.org/44632
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/lotus/filter.cxx | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sc/source/filter/lotus/filter.cxx b/sc/source/filter/lotus/filter.cxx index 605ba6d52009..da1bd167eb4e 100644 --- a/sc/source/filter/lotus/filter.cxx +++ b/sc/source/filter/lotus/filter.cxx @@ -77,11 +77,11 @@ generate_Opcodes(LotusContext &rContext, SvStream& aStream, aStream.Seek( STREAM_SEEK_TO_END ); sal_uInt64 const nStrmSize = aStream.Tell(); aStream.Seek( STREAM_SEEK_TO_BEGIN ); - while( !rContext.bEOF && !aStream.IsEof() && (aStream.Tell() < nStrmSize) ) + while (!rContext.bEOF && aStream.good() && (aStream.Tell() < nStrmSize)) { - sal_uInt16 nOpcode, nLength; + sal_uInt16 nOpcode(LOTUS_EOF), nLength(0); - aStream.ReadUInt16( nOpcode ).ReadUInt16( nLength ); + aStream.ReadUInt16(nOpcode).ReadUInt16(nLength); aPrgrsBar.Progress(); if( nOpcode == LOTUS_EOF ) rContext.bEOF = true; @@ -137,7 +137,7 @@ WKTYP ScanVersion(SvStream& aStream) aStream.ReadUInt16( nRecLen ).ReadUInt16( nVersNr ); - if( aStream.IsEof() ) + if (!aStream.good()) return eWK_Error; switch( nVersNr ) @@ -156,12 +156,14 @@ WKTYP ScanVersion(SvStream& aStream) case 0x1000: aStream.ReadUInt16( nVersNr ); - if( aStream.IsEof() ) return eWK_Error; + if (!aStream.good()) + return eWK_Error; if( nVersNr == 0x0004 && nRecLen == 26 ) - { // 4 bytes of 26 read => skip 22 (read instead of seek to make IsEof() work just in case) + { + // 4 bytes of 26 read => skip 22 (read instead of seek to make IsEof() work just in case) sal_Char aDummy[22]; aStream.ReadBytes(aDummy, 22); - return aStream.IsEof() ? eWK_Error : eWK3; + return !aStream.good() ? eWK_Error : eWK3; } break; case 0x1003: |