summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-12-31 16:29:06 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-01-01 20:41:04 +0100
commit96ea80a725dfe4ef38993f78917c243f13e3beb5 (patch)
tree095af864e02c8680c85660fa5a1017f7bac89a1c
parentfed54ff3f2b54ad91650154546a1c5f55d67b859 (diff)
ofz#29129 Abrt on uncaught exception
Change-Id: I249e1f6e2fcc94e5de22d1f7c7d8a0e7cc185ace Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108540 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sd/qa/unit/data/ppt/pass/crash-1.ppt (renamed from sd/qa/unit/data/ppt/fail/crash-1.ppt)bin7677 -> 7677 bytes
-rw-r--r--sd/qa/unit/data/ppt/pass/hang-4.ppt (renamed from sd/qa/unit/data/ppt/fail/hang-4.ppt)bin7712 -> 7712 bytes
-rw-r--r--sd/qa/unit/data/ppt/pass/hang-6.ppt (renamed from sd/qa/unit/data/ppt/fail/hang-6.ppt)bin7712 -> 7712 bytes
-rw-r--r--sfx2/source/doc/oleprops.cxx9
4 files changed, 5 insertions, 4 deletions
diff --git a/sd/qa/unit/data/ppt/fail/crash-1.ppt b/sd/qa/unit/data/ppt/pass/crash-1.ppt
index 5d1a04b33cea..5d1a04b33cea 100644
--- a/sd/qa/unit/data/ppt/fail/crash-1.ppt
+++ b/sd/qa/unit/data/ppt/pass/crash-1.ppt
Binary files differ
diff --git a/sd/qa/unit/data/ppt/fail/hang-4.ppt b/sd/qa/unit/data/ppt/pass/hang-4.ppt
index f5aa24752180..f5aa24752180 100644
--- a/sd/qa/unit/data/ppt/fail/hang-4.ppt
+++ b/sd/qa/unit/data/ppt/pass/hang-4.ppt
Binary files differ
diff --git a/sd/qa/unit/data/ppt/fail/hang-6.ppt b/sd/qa/unit/data/ppt/pass/hang-6.ppt
index f5aa24752180..f5aa24752180 100644
--- a/sd/qa/unit/data/ppt/fail/hang-6.ppt
+++ b/sd/qa/unit/data/ppt/pass/hang-6.ppt
Binary files differ
diff --git a/sfx2/source/doc/oleprops.cxx b/sfx2/source/doc/oleprops.cxx
index 796ce0d5227a..621a82f6d9a5 100644
--- a/sfx2/source/doc/oleprops.cxx
+++ b/sfx2/source/doc/oleprops.cxx
@@ -941,12 +941,13 @@ void SfxOleSection::ImplLoad( SvStream& rStrm )
mnStartPos = rStrm.Tell();
sal_uInt32 nSize(0);
sal_Int32 nPropCount(0);
- rStrm.ReadUInt32( nSize ).ReadInt32( nPropCount );
+ if (rStrm.remainingSize() >= 8)
+ rStrm.ReadUInt32( nSize ).ReadInt32( nPropCount );
// read property ID/position pairs
typedef ::std::map< sal_Int32, sal_uInt32 > SfxOlePropPosMap;
SfxOlePropPosMap aPropPosMap;
- for (sal_Int32 nPropIdx = 0; nPropIdx < nPropCount && rStrm.good(); ++nPropIdx)
+ for (sal_Int32 nPropIdx = 0; nPropIdx < nPropCount && rStrm.good() && rStrm.remainingSize() >= 8; ++nPropIdx)
{
sal_Int32 nPropId(0);
sal_uInt32 nPropPos(0);
@@ -956,7 +957,7 @@ void SfxOleSection::ImplLoad( SvStream& rStrm )
// read codepage property
SfxOlePropPosMap::iterator aCodePageIt = aPropPosMap.find( PROPID_CODEPAGE );
- if( (aCodePageIt != aPropPosMap.end()) && SeekToPropertyPos( rStrm, aCodePageIt->second ) )
+ if( (aCodePageIt != aPropPosMap.end()) && SeekToPropertyPos(rStrm, aCodePageIt->second) && rStrm.remainingSize() >= 4)
{
// codepage property must be of type signed int-16
sal_Int32 nPropType(0);
@@ -972,7 +973,7 @@ void SfxOleSection::ImplLoad( SvStream& rStrm )
if( (aDictIt != aPropPosMap.end()) && SeekToPropertyPos( rStrm, aDictIt->second ) )
{
// #i66214# #i66428# applications may write broken dictionary properties in wrong sections
- if( mbSupportsDict )
+ if (mbSupportsDict && rStrm.remainingSize() >= 4)
{
// dictionary property contains number of pairs in property type field
sal_Int32 nNameCount(0);