summaryrefslogtreecommitdiffstats
path: root/basic
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-03-30 22:31:53 +0200
committerMichael Stahl <mstahl@redhat.com>2014-03-30 22:41:48 +0200
commitba46f32c804e665741a6db6f2578a01045304d14 (patch)
treea0f140454829c8179264f309cdae8a8367911834 /basic
parentsot: fix some bizarre resize code that creates 4G temp files on 32bit (diff)
downloadcore-ba46f32c804e665741a6db6f2578a01045304d14.tar.gz
core-ba46f32c804e665741a6db6f2578a01045304d14.zip
deploy some asserts to detect truncated STREAM_SEEK_TO_END
Since STREAM_SEEK_TO_END is now 64 bits it could happen that some existing code uses it in some indirect manner and it gets truncated to 32 bits somewhere (on 32 bit platforms); try to detect that with asserts. Of course the checked value is now a valid stream position, so perhaps the checks should eventually be removed. Change-Id: I4248c00d758220bdc3ee94c7aa7a7bd4c86c57f0
Diffstat (limited to 'basic')
-rw-r--r--basic/source/runtime/iosys.cxx2
1 files changed, 2 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 );