1
0
Fork 0

Removed dangerous use of tmpnam()

This commit is contained in:
bagyenda 2005-06-01 05:20:23 +00:00
parent d921d00ae8
commit 89f4fa061f
1 changed files with 7 additions and 1 deletions

View File

@ -617,7 +617,13 @@ static void remove_object(MIMEEntity *m, Octstr *ctype)
static void mktmpfname(char fname[])
{
tmpname(fname);
sprintf(fname, "%s/t%ld.%ld.%ld",
#ifdef P_tmpdir
P_tmpdir,
#else
"/tmp"
#endif
random(), (long)getpid(), (long)time(NULL));
}
static Octstr *mknewname(Octstr *oldname, char *ext)