summaryrefslogtreecommitdiff
path: root/sd/source/filter/ppt
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-01-13 16:31:37 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-01-14 09:55:29 +0100
commita62b421440de305a910d4ace4c146012f9f25e14 (patch)
treea91cf9a03deeaf8d79fa8496a6aa531dabce3332 /sd/source/filter/ppt
parentedc748c9be3037a88c0f37ace160946e4fbd2a2d (diff)
ofz#20066 Timeout
Change-Id: Idd0ac51279c99e17c6f890096c7b6daf1b1802ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86703 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd/source/filter/ppt')
-rw-r--r--sd/source/filter/ppt/propread.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/sd/source/filter/ppt/propread.cxx b/sd/source/filter/ppt/propread.cxx
index 1aaf42064a8c..6a8416343d6d 100644
--- a/sd/source/filter/ppt/propread.cxx
+++ b/sd/source/filter/ppt/propread.cxx
@@ -17,12 +17,13 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <memory>
#include "propread.hxx"
#include <rtl/tencinfo.h>
#include <rtl/textenc.h>
#include <sal/log.hxx>
+#include <o3tl/sorted_vector.hxx>
#include <osl/diagnose.h>
+#include <memory>
PropEntry::PropEntry( sal_uInt32 nId, const sal_uInt8* pBuf, sal_uInt32 nBufSize ) :
mnId ( nId ),
@@ -348,7 +349,9 @@ void Section::Read( SotStorageStream *pStrm )
bool bVariant = ( nPropType == VT_VARIANT );
- for (sal_uInt32 i = 0; nPropSize && ( i < nVectorCount ); ++i)
+ o3tl::sorted_vector<sal_uInt64> aVisitedOffsets;
+
+ for (sal_uInt32 i = 0; nPropSize && i < nVectorCount && pStrm->good(); ++i)
{
if ( bVariant )
{
@@ -427,6 +430,12 @@ void Section::Read( SotStorageStream *pStrm )
nOffset = nPropOfs + nSecOfs + nPropSize;
if (!checkSeek(*pStrm, nOffset))
break;
+ // inserts returns false if an equivalent element already existed
+ if (!aVisitedOffsets.insert(nOffset).second)
+ {
+ SAL_WARN("sd.filter", "loop in Section::Read property list");
+ break;
+ }
}
}
else