coverity#705989 silence Insecure temporary file

and

coverity#705983 Insecure temporary file

Change-Id: I2a501f8114ddf8968381e1880263abaf9d1bdc6f
This commit is contained in:
Caolán McNamara 2014-11-14 11:06:44 +00:00
parent 64cc39e0c5
commit bbf3aa7f92
3 changed files with 11 additions and 5 deletions

View File

@ -24,6 +24,7 @@ $(eval $(call gb_Library_use_libraries,scn,\
svt \
vcl \
tl \
utl \
comphelper \
cppuhelper \
cppu \

View File

@ -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;

View File

@ -35,6 +35,8 @@
#include "rtl/ustring.hxx"
#include "rtl/strbuf.hxx"
#include <unotools/tempfile.hxx>
#include <set>
#include <map>
#include <algorithm>
@ -59,9 +61,6 @@ GlyphSet::~GlyphSet ()
/* FIXME delete the glyphlist ??? */
}
bool
GlyphSet::GetCharID (
sal_Unicode nChar,
@ -742,7 +741,10 @@ GlyphSet::PSUploadFont (osl::File& rOutFile, PrinterGfx &rGfx, bool bAllowType42
sal_Int32 nSuccess = OpenTTFontFile(aTTFileName.getStr(), nFace, &pTTFont);
if (nSuccess != SF_OK)
return false;
FILE* pTmpFile = tmpfile();
utl::TempFile aTmpFile;
aTmpFile.EnableKillingFile();
FILE* pTmpFile = fopen(OUStringToOString(aTmpFile.GetFileName(), osl_getThreadTextEncoding()).getStr(), "wb");
if (pTmpFile == NULL)
return false;