summaryrefslogtreecommitdiff
path: root/print/ghostscript8/files/patch-ad
blob: 943abecaa75501088a317eacb39f20ac718b873e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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);
 }