Kaydet (Commit) 5db93465 authored tarafından Caolán McNamara's avatar Caolán McNamara

CID#705986 avoid tmpnam

Change-Id: I47fa843284a074ef77da8631f4e4de914f4d0cf7
üst 5f5a981d
......@@ -30,6 +30,8 @@
#include <stdlib.h>
#include <unistd.h>
#include <pwd.h>
#include <sys/types.h>
#include <sys/stat.h>
#define RCFILE ".crash_reportrc"
......@@ -206,8 +208,12 @@ namespace svx{
OUString strSubject(GetDocType());
osl_setEnvironment(sSubEnvVar.pData, strSubject.pData);
char szBodyFile[L_tmpnam] = "";
FILE *fp = fopen( tmpnam( szBodyFile ), "w" );
char szBodyFile[]="/tmp/locrsXXXXXXX";
mode_t nOrigMode = umask(S_IRWXG | S_IRWXO);
int nDescriptor = mkstemp(szBodyFile);
umask(nOrigMode);
FILE *fp = nDescriptor != -1 ? fdopen(nDescriptor, "w") : NULL;
if ( fp )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment