diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-06-18 09:38:30 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-06-18 11:12:09 +0100 |
commit | e457db4f9d2cfc14f71a5bb2260ee5a4c057d282 (patch) | |
tree | 4bb1815fb356e0653d2e4898ca7641a219b9061d /sw | |
parent | 358c1fa7faebd20a6fb9aa3c55503fa411a7bc44 (diff) |
coverity#706098 Unintended sign extension
Change-Id: Iccc81722785a269dc490270dab6ec42eebf9144d
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/docsort.cxx | 5 |
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 ); } |