summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basic/source/runtime/iosys.cxx2
-rw-r--r--sot/source/sdstor/stgstrms.cxx2
-rw-r--r--sot/source/sdstor/ucbstorage.cxx3
-rw-r--r--svl/source/misc/strmadpt.cxx4
-rw-r--r--tools/source/stream/stream.cxx6
-rw-r--r--tools/source/stream/strmunx.cxx2
-rw-r--r--tools/source/stream/strmwnt.cxx2
7 files changed, 21 insertions, 0 deletions
diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx
index 940d6d5a4264..43942b8d9426 100644
--- a/basic/source/runtime/iosys.cxx
+++ b/basic/source/runtime/iosys.cxx
@@ -374,6 +374,8 @@ sal_Size OslStream::PutData(const void* pData, sal_Size nSize)
sal_uInt64 OslStream::SeekPos( sal_uInt64 nPos )
{
::osl::FileBase::RC rc = ::osl::FileBase::E_None;
+ // check if a truncated STREAM_SEEK_TO_END was passed
+ assert(nPos != (sal_uInt64)(sal_uInt32)STREAM_SEEK_TO_END);
if( nPos == STREAM_SEEK_TO_END )
{
rc = maFile.setPos( osl_Pos_End, 0 );
diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx
index fcd196131761..214b32ebda52 100644
--- a/sot/source/sdstor/stgstrms.cxx
+++ b/sot/source/sdstor/stgstrms.cxx
@@ -1283,6 +1283,8 @@ sal_uLong StgTmpStrm::PutData( const void* pData, sal_uLong n )
sal_uInt64 StgTmpStrm::SeekPos(sal_uInt64 n)
{
+ // check if a truncated STREAM_SEEK_TO_END was passed
+ assert(n != (sal_uInt64)(sal_uInt32)STREAM_SEEK_TO_END);
if( n == STREAM_SEEK_TO_END )
n = GetSize();
if( n && n > THRESHOLD && !pStrm )
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index 8c0be298bfb7..deb5303eb1b4 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -941,6 +941,9 @@ sal_uLong UCBStorageStream_Impl::PutData( const void* pData, sal_uLong nSize )
sal_uInt64 UCBStorageStream_Impl::SeekPos(sal_uInt64 const nPos)
{
+ // check if a truncated STREAM_SEEK_TO_END was passed
+ assert(nPos != (sal_uInt64)(sal_uInt32)STREAM_SEEK_TO_END);
+
if( !Init() )
return 0;
diff --git a/svl/source/misc/strmadpt.cxx b/svl/source/misc/strmadpt.cxx
index a55a0faa683d..bc7eaac93ca2 100644
--- a/svl/source/misc/strmadpt.cxx
+++ b/svl/source/misc/strmadpt.cxx
@@ -448,6 +448,8 @@ sal_uLong SvInputStream::GetData(void * pData, sal_uLong nSize)
SetError(ERRCODE_IO_CANTREAD);
return 0;
}
+ // check if a truncated STREAM_SEEK_TO_END was passed
+ assert(m_nSeekedFrom != (sal_uInt64)(sal_uInt32)STREAM_SEEK_TO_END);
sal_uInt32 nRead = 0;
if (m_xSeekable.is())
{
@@ -548,6 +550,8 @@ void SvInputStream::FlushData()
// virtual
sal_uInt64 SvInputStream::SeekPos(sal_uInt64 const nPos)
{
+ // check if a truncated STREAM_SEEK_TO_END was passed
+ assert(nPos != (sal_uInt64)(sal_uInt32)STREAM_SEEK_TO_END);
if (open())
{
if (nPos == STREAM_SEEK_TO_END)
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index 48cae55f0169..9921d6f8a4dc 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -308,6 +308,8 @@ ErrCode SvAsyncLockBytes::FillAppend(const void * pBuffer, sal_Size nCount,
// virtual
sal_uInt64 SvAsyncLockBytes::Seek(sal_uInt64 const nPos)
{
+ // check if a truncated STREAM_SEEK_TO_END was passed
+ assert(nPos != (sal_uInt64)(sal_uInt32)STREAM_SEEK_TO_END);
if (nPos != STREAM_SEEK_TO_END)
m_nSize = nPos;
return m_nSize;
@@ -343,6 +345,8 @@ sal_Size SvStream::PutData( const void* pData, sal_Size nSize )
sal_uInt64 SvStream::SeekPos(sal_uInt64 const nPos)
{
+ // check if a truncated STREAM_SEEK_TO_END was passed
+ assert(nPos != (sal_uInt64)(sal_uInt32)STREAM_SEEK_TO_END);
if( !GetError() && nPos == STREAM_SEEK_TO_END )
{
DBG_ASSERT( xLockBytes.Is(), "pure virtual function" );
@@ -1839,6 +1843,8 @@ sal_uInt64 SvMemoryStream::SeekPos(sal_uInt64 const nNewPos)
// nEndOfData: First position in stream not allowed to read from
// nSize: Size of allocated buffer
+ // check if a truncated STREAM_SEEK_TO_END was passed
+ assert(nNewPos != (sal_uInt64)(sal_uInt32)STREAM_SEEK_TO_END);
if( nNewPos < nEndOfData )
nPos = nNewPos;
else if( nNewPos == STREAM_SEEK_TO_END )
diff --git a/tools/source/stream/strmunx.cxx b/tools/source/stream/strmunx.cxx
index 010bcc6660c6..c3144ed3bd57 100644
--- a/tools/source/stream/strmunx.cxx
+++ b/tools/source/stream/strmunx.cxx
@@ -358,6 +358,8 @@ sal_Size SvFileStream::PutData( const void* pData, sal_Size nSize )
sal_uInt64 SvFileStream::SeekPos(sal_uInt64 const nPos)
{
+ // check if a truncated STREAM_SEEK_TO_END was passed
+ assert(nPos != (sal_uInt64)(sal_uInt32)STREAM_SEEK_TO_END);
if ( IsOpen() )
{
oslFileError rc;
diff --git a/tools/source/stream/strmwnt.cxx b/tools/source/stream/strmwnt.cxx
index d5f519fcef05..ad4f1336339b 100644
--- a/tools/source/stream/strmwnt.cxx
+++ b/tools/source/stream/strmwnt.cxx
@@ -162,6 +162,8 @@ sal_Size SvFileStream::PutData( const void* pData, sal_Size nSize )
sal_uInt64 SvFileStream::SeekPos(sal_uInt64 const nPos)
{
+ // check if a truncated STREAM_SEEK_TO_END was passed
+ assert(nPos != (sal_uInt64)(sal_uInt32)STREAM_SEEK_TO_END);
DWORD nNewPos = 0;
if( IsOpen() )
{