diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-02-05 23:30:22 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-02-05 23:33:35 +0100 |
commit | 004304eb2fd1703d22dec0abf0170bb2ce493d0c (patch) | |
tree | 2cc68735fa3eb215f043fa6f175f3fcb0e03f88f /ucb | |
parent | b0ef5cf258f3a84054c052f0a09a208dbc17fdf3 (diff) |
try to avoid overflows in some compare functions
Change-Id: I6144d7d6527dc401b7f1b577d1a227361e39e7bb
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/sorter/sortresult.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ucb/source/sorter/sortresult.cxx b/ucb/source/sorter/sortresult.cxx index d5fcabf5069e..c4cec6ea031f 100644 --- a/ucb/source/sorter/sortresult.cxx +++ b/ucb/source/sorter/sortresult.cxx @@ -1286,7 +1286,7 @@ sal_IntPtr SortedResultSet::FindPos( SortListData *pEntry, nCompare = Compare( pEntry, pMid ); if ( !nCompare ) - nCompare = reinterpret_cast<sal_IntPtr>(pEntry) - reinterpret_cast<sal_IntPtr>(pMid); + nCompare = (pEntry != pMid) ? ((pEntry < pMid) ? -1 : 1) : 0; if ( nCompare < 0 ) // pEntry < pMid nEnd = nMid - 1; |