diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-11-14 11:06:44 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-11-14 12:02:49 +0000 |
commit | bbf3aa7f92c194c9cc4546c95706e6b28e0c070c (patch) | |
tree | 93467eccdc8f3b2f1acb867c18d988665ca9aa99 /extensions/source/scanner | |
parent | 64cc39e0c576611297625ebcac8d48613a5bb175 (diff) |
coverity#705989 silence Insecure temporary file
and
coverity#705983 Insecure temporary file
Change-Id: I2a501f8114ddf8968381e1880263abaf9d1bdc6f
Diffstat (limited to 'extensions/source/scanner')
-rw-r--r-- | extensions/source/scanner/sane.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/extensions/source/scanner/sane.cxx b/extensions/source/scanner/sane.cxx index fbf7c3c20da2..84475d572b5c 100644 --- a/extensions/source/scanner/sane.cxx +++ b/extensions/source/scanner/sane.cxx @@ -21,6 +21,7 @@ #include <math.h> #include <osl/file.h> #include <tools/stream.hxx> +#include <unotools/tempfile.hxx> #include <sane.hxx> #include <dlfcn.h> #include <stdio.h> @@ -694,7 +695,9 @@ bool Sane::Start( BitmapTransporter& rBitmap ) if( nStatus != SANE_STATUS_GOOD ) bSynchronousRead = true; } - FILE* pFrame = tmpfile(); + utl::TempFile aFrame; + aFrame.EnableKillingFile(); + FILE* pFrame = fopen(OUStringToOString(aFrame.GetFileName(), osl_getThreadTextEncoding()).getStr(), "wb"); if( ! pFrame ) { bSuccess = false; |