summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-06-18 09:38:30 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-06-18 11:12:09 +0100
commite457db4f9d2cfc14f71a5bb2260ee5a4c057d282 (patch)
tree4bb1815fb356e0653d2e4898ca7641a219b9061d /sw
parent358c1fa7faebd20a6fb9aa3c55503fa411a7bc44 (diff)
coverity#706098 Unintended sign extension
Change-Id: Iccc81722785a269dc490270dab6ec42eebf9144d
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 );
}