diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2006-06-19 23:18:25 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2006-06-19 23:18:25 +0000 |
commit | a7585f28c5ff940ea58aa83f2a839466deb78c57 (patch) | |
tree | d4162b5e59de40c37264f548d1ed0c5aa8d6df93 /io/source | |
parent | 52fcec829ac3af8059250a6a755f8eb9853a8c1a (diff) |
INTEGRATION: CWS warnings01 (1.2.88); FILE MERGED
2005/09/22 20:30:03 sb 1.2.88.2: RESYNC: (1.2-1.3); FILE MERGED
2005/09/01 08:14:29 sb 1.2.88.1: #i53898# Made code warning-free.
Diffstat (limited to 'io/source')
-rw-r--r-- | io/source/stm/streamhelper.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/io/source/stm/streamhelper.cxx b/io/source/stm/streamhelper.cxx index cb93876e6..3fd2fcb14 100644 --- a/io/source/stm/streamhelper.cxx +++ b/io/source/stm/streamhelper.cxx @@ -4,9 +4,9 @@ * * $RCSfile: streamhelper.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: rt $ $Date: 2005-09-07 18:31:59 $ + * last change: $Author: hr $ $Date: 2006-06-20 00:18:25 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -34,6 +34,7 @@ ************************************************************************/ #include <rtl/alloc.h> +#include <limits> #include <string.h> #include <com/sun/star/uno/Sequence.hxx> @@ -166,7 +167,7 @@ void MemRingBuffer::writeAt( sal_Int32 nPos, const Sequence<sal_Int8> &seq ) checkInvariants(); sal_Int32 nLen = seq.getLength(); - if( nPos > 0x80000000 || nPos < 0 || nPos + nLen < 0 || nPos + nLen > 0x80000000 ) + if( nPos < 0 || nPos > std::numeric_limits< sal_Int32 >::max() - nLen ) { throw IRingBuffer_OutOfBoundsException(); } |