From 1b40966fd0dd7e30c9fff40cc0dfcc15c3456221 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Sun, 30 Mar 2014 22:22:26 +0200 Subject: sot: fix some bizarre resize code that creates 4G temp files on 32bit StgTmpStrm::SetSize(): the nEndOfData - 1 may underflow if nEndOfData=0 which happened to be the same value of STREAM_SEEK_TO_END before but not any more; also it's a mystery to me why the last byte in the buffer would need to be overwritten with 0 here. This also fixes the failure of ww8_export test. Change-Id: Iefe5a22c667ee83fbc315d772f357b913105ad93 --- sot/source/sdstor/stgstrms.cxx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'sot') diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx index 680daf26afbd..fcd196131761 100644 --- a/sot/source/sdstor/stgstrms.cxx +++ b/sot/source/sdstor/stgstrms.cxx @@ -1241,10 +1241,7 @@ void StgTmpStrm::SetSize(sal_uInt64 n) { if( n > nEndOfData ) { - sal_uInt64 nCur = Tell(); - Seek( nEndOfData - 1 ); - WriteUChar( (sal_uInt8) 0 ); - Seek( nCur ); + SvMemoryStream::SetSize(n); } else nEndOfData = n; -- cgit