summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-05-24 14:15:56 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-05-25 09:26:13 +0100
commit07edde2ddd309f47ddf5360f7133c181791cb3d0 (patch)
tree4221d46254c09e7c0ccb95f849f2ae2050bb1d56 /filter
parent1504284cedc64165462663be0e1d8a6624b78e2d (diff)
check some bounds conditions
Change-Id: Iab2f715b37d9fae816723b84ee1116fd4aff9537
Diffstat (limited to 'filter')
-rw-r--r--filter/source/msfilter/msdffimp.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 5b6c86ccb21b..c4a6bca55771 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -5884,6 +5884,11 @@ void SvxMSDffManager::GetFidclData( sal_uInt32 nOffsDggL )
"escher", "FIDCL list longer than remaining bytes, ppt or parser is wrong");
mnIdClusters = std::min(nMaxEntriesPossible, static_cast<sal_Size>(mnIdClusters));
+ sal_Size nMaxEntriesAllocatable = SAL_MAX_UINT32 / sizeof(FIDCL);
+ SAL_WARN_IF(nMaxEntriesAllocatable < mnIdClusters,
+ "escher", "FIDCL list longer than can be allocated");
+ mnIdClusters = std::min(nMaxEntriesAllocatable, static_cast<sal_Size>(mnIdClusters));
+
mpFidcls = new FIDCL[ mnIdClusters ];
memset(mpFidcls, 0, mnIdClusters * sizeof(FIDCL));
for (sal_uInt32 i = 0; i < mnIdClusters; ++i)