This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch: libiberty/choose_temp.c replace mktemp with mkstemp
> The call of mktemp() is considered as a potential security
> risk. Thus, the following patch replaces it with mkstemp in the file
> libiberty/choose-temp.c. After applying the appended patch, I
> bootstrapped the compiler and ran the testsuites. There were no
> regressions.
(1) Did you try bootstrapping on systems that don't provide mkstemp?
(2) mkstemp opens the file, but you never close it. In fact, you
don't save the file descriptor at all.