summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-09-19 22:01:00 +0200
committerMichael Stahl <mstahl@redhat.com>2017-09-19 22:18:44 +0200
commitec100b7066d5a00178deb3a1625da07fd1c3b416 (patch)
tree1d67bff233f99ac57b1bf38e48afc3938539bac0 /sc
parentee599ea46365adc37f4d495d9ff9778c25c04c92 (diff)
sc: fix infinite loop in XclImpDffConverter::ProcessShGrContainer()
... and also in XclImpDffConverter::ProcessDgContainer() This was looping in CppunitTest_sc_filters_test, reportedly since commit 7e8c38b69742ff037a5e239bf0f02665f053ea53. The problem is that checkSeek() doesn't actually seek until EOF if the offset is too large. Change-Id: I16226a88388dcac8069d6a4cad860470540466e3
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/excel/xiescher.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index 17c4f163c886..fd13897d33d1 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -3684,7 +3684,8 @@ OUString XclImpDffConverter::ReadHlinkProperty( SvStream& rDffStrm ) const
void XclImpDffConverter::ProcessDgContainer( SvStream& rDffStrm, const DffRecordHeader& rDgHeader )
{
std::size_t nEndPos = rDgHeader.GetRecEndFilePos();
- while( rDffStrm.Tell() < nEndPos )
+ bool isBreak(false);
+ while (!isBreak && rDffStrm.good() && rDffStrm.Tell() < nEndPos)
{
DffRecordHeader aHeader;
ReadDffRecordHeader( rDffStrm, aHeader );
@@ -3697,7 +3698,7 @@ void XclImpDffConverter::ProcessDgContainer( SvStream& rDffStrm, const DffRecord
ProcessShGrContainer( rDffStrm, aHeader );
break;
default:
- aHeader.SeekToEndOfRecord( rDffStrm );
+ isBreak = !aHeader.SeekToEndOfRecord( rDffStrm );
}
}
// seek to end of drawing page container
@@ -3713,7 +3714,8 @@ void XclImpDffConverter::ProcessDgContainer( SvStream& rDffStrm, const DffRecord
void XclImpDffConverter::ProcessShGrContainer( SvStream& rDffStrm, const DffRecordHeader& rShGrHeader )
{
std::size_t nEndPos = rShGrHeader.GetRecEndFilePos();
- while( rDffStrm.Tell() < nEndPos )
+ bool isBreak(false);
+ while (!isBreak && rDffStrm.good() && rDffStrm.Tell() < nEndPos)
{
DffRecordHeader aHeader;
ReadDffRecordHeader( rDffStrm, aHeader );
@@ -3724,7 +3726,7 @@ void XclImpDffConverter::ProcessShGrContainer( SvStream& rDffStrm, const DffReco
ProcessShContainer( rDffStrm, aHeader );
break;
default:
- aHeader.SeekToEndOfRecord( rDffStrm );
+ isBreak = !aHeader.SeekToEndOfRecord( rDffStrm );
}
}
// seek to end of shape group container