* Bug #15213, #18635: The use of the insecure m_scratch() and
[mmh] / uip / rcvstore.c
index 21f6c77..668eb86 100644 (file)
@@ -173,9 +173,10 @@ main (int argc, char **argv)
     SIGNAL (SIGTERM, SIG_IGN);
 
     /* create a temporary file */
-    tmpfilenam = m_scratch ("", invo_name);
-    if ((fd = creat (tmpfilenam, m_gmprot ())) == NOTOK)
-       adios (tmpfilenam, "unable to create");
+    tmpfilenam = m_mktemp (invo_name, &fd, NULL);
+    if (tmpfilenam == NULL) {
+       adios ("rcvstore", "unable to create temporary file");
+    }
     chmod (tmpfilenam, m_gmprot());
 
     /* copy the message from stdin into temp file */