Sophie

Sophie

distrib > Mandriva > 2009.1 > x86_64 > media > main-release-src > by-pkgid > 3c83bbb1176e313dd084f0338245b0ec > files > 24

tetex-3.0-48mdv2009.1.src.rpm

--- tetex-src-3.0/texk/dvipdfm/psimage.c.dvipdfmsec	2001-06-28 21:55:26.000000000 +0200
+++ tetex-src-3.0/texk/dvipdfm/psimage.c	2005-02-07 14:08:18.055138172 +0100
@@ -113,10 +113,15 @@
 {
 #ifdef HAVE_SYSTEM
   pdf_obj *result = NULL;
-  char *tmp, *cmd;
+  char tmp[] = "/tmp/dvipdfm.XXXXXX", *cmd;
+  int tfd;
   FILE *pdf_file = NULL;
   /* Get a full qualified tmp name */
-  tmp = tmpnam (NULL);
+  tfd = mkstemp (tmp);
+  if (tfd == -1) {
+    fprintf (stderr, "\nCouldn't create temporary file for output\n");
+    return NULL;
+  } else close (tfd);
   if ((cmd = build_command_line (file_name, tmp))) {
     if (!system (cmd) && (pdf_file = MFOPEN (tmp, FOPEN_RBIN_MODE))) {
       result = pdf_include_page (pdf_file, p, res_name);