1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # T2 SDE: package/.../id3lib/CVE-2007-4460.patch
5 # Copyright (C) 2007 The T2 SDE Project
7 # More information can be found in the files COPYING and README.
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
15 # --- T2-COPYRIGHT-NOTE-END ---
17 diff -Nur id3lib-3.8.3-orig/src/tag_file.cpp id3lib-3.8.3/src/tag_file.cpp
18 --- id3lib-3.8.3-orig/src/tag_file.cpp 2007-11-04 16:22:35.000000000 +0000
19 +++ id3lib-3.8.3/src/tag_file.cpp 2007-11-04 16:23:11.000000000 +0000
21 strcpy(sTempFile, filename.c_str());
22 strcat(sTempFile, sTmpSuffix.c_str());
24 -#if ((defined(__GNUC__) && __GNUC__ >= 3 ) || !defined(HAVE_MKSTEMP))
25 - // This section is for Windows folk && gcc 3.x folk
26 +#if !defined(HAVE_MKSTEMP)
27 + // This section is for Windows folk
29 createFile(sTempFile, tmpOut);
32 tmpOut.write((char *)tmpBuffer, nBytes);
35 -#else //((defined(__GNUC__) && __GNUC__ >= 3 ) || !defined(HAVE_MKSTEMP))
36 +#else //!defined(HAVE_MKSTEMP)
38 // else we gotta make a temp file, copy the tag into it, copy the
39 // rest of the old file after the tag, delete the old file, rename
41 //ID3_THROW_DESC(ID3E_NoFile, "couldn't open temp file");
44 - ofstream tmpOut(fd);
45 + ofstream tmpOut(sTempFile);
50 uchar tmpBuffer[BUFSIZ];
53 - file.read(tmpBuffer, BUFSIZ);
54 + file.read((char *)tmpBuffer, BUFSIZ);
55 size_t nBytes = file.gcount();
56 - tmpOut.write(tmpBuffer, nBytes);
57 + tmpOut.write((char *)tmpBuffer, nBytes);
60 close(fd); //closes the file
62 -#endif ////((defined(__GNUC__) && __GNUC__ >= 3 ) || !defined(HAVE_MKSTEMP))
63 +#endif ////!defined(HAVE_MKSTEMP)