aboutsummaryrefslogtreecommitdiff
path: root/audio/id3lib
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2007-10-02 01:59:40 +0000
committerXin LI <delphij@FreeBSD.org>2007-10-02 01:59:40 +0000
commit7ab0401bee9499f7c8b1ed6fb807727aa854e8ce (patch)
tree388d827855de6d4fc1be58bf0c6cc7d907d466a1 /audio/id3lib
parentcbec3d25f618dd31158cb496e48702b9dff7e56a (diff)
downloadports-7ab0401bee9499f7c8b1ed6fb807727aa854e8ce.tar.gz
ports-7ab0401bee9499f7c8b1ed6fb807727aa854e8ce.zip
Add a patch which fixes CVE-2007-4460, insecure temporary file
handling. Approved by: maintainer
Notes
Notes: svn path=/head/; revision=200581
Diffstat (limited to 'audio/id3lib')
-rw-r--r--audio/id3lib/files/patch-CVE-2007-446049
1 files changed, 49 insertions, 0 deletions
diff --git a/audio/id3lib/files/patch-CVE-2007-4460 b/audio/id3lib/files/patch-CVE-2007-4460
new file mode 100644
index 000000000000..3ecda4322a1c
--- /dev/null
+++ b/audio/id3lib/files/patch-CVE-2007-4460
@@ -0,0 +1,49 @@
+--- ./src/tag_file.cpp.orig 2003-03-02 08:23:00.000000000 +0800
++++ ./src/tag_file.cpp 2007-10-02 05:23:26.519473634 +0800
+@@ -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();