summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-10-21 17:12:28 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-10-22 07:52:28 +0200
commitbd3929da20b5a536b82b15af552864e7549f91ef (patch)
tree87a701a707ed9396de3db1c777d87df94f6cc6de /oox
parentfcb2d8a87ad696f7f2fe069f0ed68a88803e1b54 (diff)
Rather not put unencrypted doc in a tempfile
Keep it in memory instead Change-Id: I25e5cb7183a4d192938110323e27f2f5d1d006fc Reviewed-on: https://gerrit.libreoffice.org/81253 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/core/filterdetect.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/oox/source/core/filterdetect.cxx b/oox/source/core/filterdetect.cxx
index a12e21d1503a..c83dab9d6f74 100644
--- a/oox/source/core/filterdetect.cxx
+++ b/oox/source/core/filterdetect.cxx
@@ -327,20 +327,23 @@ Reference< XInputStream > FilterDetect::extractUnencryptedPackage( MediaDescript
}
else
{
- // create temporary file for unencrypted package
- Reference<XStream> xTempFile( TempFile::create(mxContext), UNO_QUERY_THROW );
+ // create MemoryStream for unencrypted package - rather not put this in a tempfile
+ Reference<XStream> const xTempStream(
+ mxContext->getServiceManager()->createInstanceWithContext(
+ "com.sun.star.comp.MemoryStream", mxContext),
+ UNO_QUERY_THROW);
// if decryption was unsuccessful (corrupted file or any other reason)
- if (!aDecryptor.decrypt(xTempFile))
+ if (!aDecryptor.decrypt(xTempStream))
{
rMediaDescriptor[ MediaDescriptor::PROP_ABORTED() ] <<= true;
}
else
{
// store temp file in media descriptor to keep it alive
- rMediaDescriptor.setComponentDataEntry( "DecryptedPackage", Any( xTempFile ) );
+ rMediaDescriptor.setComponentDataEntry( "DecryptedPackage", Any( xTempStream ) );
- Reference<XInputStream> xDecryptedInputStream = xTempFile->getInputStream();
+ Reference<XInputStream> xDecryptedInputStream = xTempStream->getInputStream();
if( lclIsZipPackage( mxContext, xDecryptedInputStream ) )
return xDecryptedInputStream;
}