aboutsummaryrefslogtreecommitdiff
This patch fixes an issues where temporary files were created in an insecure
way.

It was first intruduced in version 3.8.3-7 and fixes
http://bugs.debian.org/438540
--- a/src/tag_file.cpp
+++ b/src/tag_file.cpp
@@ -242,8 +242,8 @@
     strcpy(sTempFile, filename.c_str());
     strcat(sTempFile, sTmpSuffix.c_str());
 
-#if ((defined(__GNUC__) && __GNUC__ >= 3  ) || !defined(HAVE_MKSTEMP))
-    // This section is for Windows folk && gcc 3.x folk
+#if !defined(HAVE_MKSTEMP)
+    // This section is for Windows folk
     fstream tmpOut;
     createFile(sTempFile, tmpOut);
 
@@ -257,7 +257,7 @@
       tmpOut.write((char *)tmpBuffer, nBytes);
     }
 
-#else //((defined(__GNUC__) && __GNUC__ >= 3  ) || !defined(HAVE_MKSTEMP))
+#else //!defined(HAVE_MKSTEMP)
 
     // else we gotta make a temp file, copy the tag into it, copy the
     // rest of the old file after the tag, delete the old file, rename
@@ -270,7 +270,7 @@
       //ID3_THROW_DESC(ID3E_NoFile, "couldn't open temp file");
     }
 
-    ofstream tmpOut(fd);
+    ofstream tmpOut(sTempFile);
     if (!tmpOut)
     {
       tmpOut.close();
@@ -285,14 +285,14 @@
     uchar tmpBuffer[BUFSIZ];
     while (file)
     {
-      file.read(tmpBuffer, BUFSIZ);
+      file.read((char *)tmpBuffer, BUFSIZ);
       size_t nBytes = file.gcount();
-      tmpOut.write(tmpBuffer, nBytes);
+      tmpOut.write((char *)tmpBuffer, nBytes);
     }
 
     close(fd); //closes the file
 
-#endif ////((defined(__GNUC__) && __GNUC__ >= 3  ) || !defined(HAVE_MKSTEMP))
+#endif ////!defined(HAVE_MKSTEMP)
 
     tmpOut.close();
     file.close();
e-bout@zaclys.net> Léo Le Bouter 2021-02-22gnu: nixfmt: Fix name....* gnu/packages/haskell-apps.scm (nixfmt): Fix name. Nicolas Goaziou 2021-02-22gnu: Rename ghc-nixfmt into nixfmt...* gnu/packages/haskell-xyz.scm (ghc-nixfmt): Move to... * gnu/packages/haskell-apps.scm (nixfmt): ... here. This is a followup to 703ccd583611b6efa689b7a2d1daf35d6cd83c35. Nicolas Goaziou 2021-01-28gnu: git-annex: Update to 8.20210127....* gnu/packages/haskell-apps.scm (git-annex): Update to 8.20210127. Signed-off-by: Efraim Flashner <efraim@flashner.co.il> Kyle Meyer 2020-12-01gnu: git-annex: Update to 8.20201127....* gnu/packages/haskell-apps.scm (git-annex): Update to 8.20201127. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Kyle Meyer 2020-11-25gnu: git-annex: Update to 8.20201116....If ghc-torrent isn't available, git-annex will fall back to custom legacy code. However, this older code path has a build failure in the 8.20201116 release, and in general it'd be better to rely on the preferred, more exercised code path. * gnu/packages/haskell-apps.scm (git-annex): Update to 8.20201116. [inputs]: Add ghc-torrent. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> Kyle Meyer 2020-11-08gnu: git-annex: Update to 8.20201103....* gnu/packages/haskell-apps.scm (git-annex): Update to 8.20201103. Signed-off-by: Leo Famulari <leo@famulari.name> Kyle Meyer 2020-11-04git-annex: Enable pairing and assistant features....* gnu/packages/haskell-apps.scm (git-annex): Add appropriate dependencies and adjust flags to enable "assistant" and "pairing" features. Christopher Lemmer Webber 2020-10-14gnu: kmonad: Update to 0.4.1....* gnu/packages/haskell-apps.scm (kmonad): Update to 0.4.1. Alex Griffin 2020-10-13gnu: git-annex: Update to 8.20201007....* gnu/packages/haskell-apps.scm (git-annex): Update to 8.20201007. Signed-off-by: Marius Bakke <marius@gnu.org> Kyle Meyer