mirror of
https://git.FreeBSD.org/ports.git
synced 2024-10-30 21:49:25 +00:00
9f1c27c0ec
PR: 20038 Submitted by: Mikhail Teterin <mi@aldan.algebra.com>
16 lines
425 B
Plaintext
16 lines
425 B
Plaintext
This patch replaces the use of the dangerous mktemp/fopen combo
|
|
with the safe mkstemp/fdopen.
|
|
|
|
-mi
|
|
|
|
--- src/gp_unifs.c Thu Mar 9 03:40:41 2000
|
|
+++ src/gp_unifs.c Wed Jul 19 09:56:42 2000
|
|
@@ -71,4 +71,5 @@
|
|
strcat(fname, "XXXXXX");
|
|
- mktemp(fname);
|
|
- return fopen(fname, mode);
|
|
+ len = mkstemp(fname); /* reuse the no longer needed variable */
|
|
+ if (len == -1) return NULL;
|
|
+ return fdopen(len, mode);
|
|
}
|