summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/docsort.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx
index 376171c5d732..41c6bb0a5804 100644
--- a/sw/source/core/doc/docsort.cxx
+++ b/sw/source/core/doc/docsort.cxx
@@ -758,9 +758,10 @@ FlatFndBox::FlatFndBox(SwDoc* pDocPtr, const _FndBox& rBox) :
nRows = GetRowCount(rBoxRef);
// Create linear array
- pArr = new const _FndBox*[ nRows * nCols ];
+ size_t nCount = static_cast<size_t>(nRows) * nCols;
+ pArr = new const _FndBox*[nCount];
_FndBox** ppTmp = (_FndBox**)pArr;
- memset( ppTmp, 0, sizeof(const _FndBox*) * nRows * nCols );
+ memset(ppTmp, 0, sizeof(const _FndBox*) * nCount);
FillFlat( rBoxRef );
}