Annotation of /trunk/id3lib/patches/id3lib-3.8.3-security.patch
Parent Directory | Revision Log
Revision 872 -
(hide annotations)
(download)
Thu Jul 16 16:19:24 2009 UTC (15 years, 2 months ago) by niro
File size: 1601 byte(s)
Thu Jul 16 16:19:24 2009 UTC (15 years, 2 months ago) by niro
File size: 1601 byte(s)
-added security and build fixes
1 | niro | 872 | diff -ur id3lib-3.8.3.orig/src/tag_file.cpp id3lib-3.8.3/src/tag_file.cpp |
2 | --- id3lib-3.8.3.orig/src/tag_file.cpp 2003-03-02 02:23:00.000000000 +0200 | ||
3 | +++ id3lib-3.8.3/src/tag_file.cpp 2007-08-20 19:40:16.000000000 +0300 | ||
4 | @@ -242,8 +242,8 @@ | ||
5 | strcpy(sTempFile, filename.c_str()); | ||
6 | strcat(sTempFile, sTmpSuffix.c_str()); | ||
7 | |||
8 | -#if ((defined(__GNUC__) && __GNUC__ >= 3 ) || !defined(HAVE_MKSTEMP)) | ||
9 | - // This section is for Windows folk && gcc 3.x folk | ||
10 | +#if !defined(HAVE_MKSTEMP) | ||
11 | + // This section is for Windows folk | ||
12 | fstream tmpOut; | ||
13 | createFile(sTempFile, tmpOut); | ||
14 | |||
15 | @@ -257,7 +257,7 @@ | ||
16 | tmpOut.write((char *)tmpBuffer, nBytes); | ||
17 | } | ||
18 | |||
19 | -#else //((defined(__GNUC__) && __GNUC__ >= 3 ) || !defined(HAVE_MKSTEMP)) | ||
20 | +#else //!defined(HAVE_MKSTEMP) | ||
21 | |||
22 | // else we gotta make a temp file, copy the tag into it, copy the | ||
23 | // rest of the old file after the tag, delete the old file, rename | ||
24 | @@ -270,7 +270,7 @@ | ||
25 | //ID3_THROW_DESC(ID3E_NoFile, "couldn't open temp file"); | ||
26 | } | ||
27 | |||
28 | - ofstream tmpOut(fd); | ||
29 | + ofstream tmpOut(sTempFile); | ||
30 | if (!tmpOut) | ||
31 | { | ||
32 | tmpOut.close(); | ||
33 | @@ -285,14 +285,14 @@ | ||
34 | uchar tmpBuffer[BUFSIZ]; | ||
35 | while (file) | ||
36 | { | ||
37 | - file.read(tmpBuffer, BUFSIZ); | ||
38 | + file.read((char *)tmpBuffer, BUFSIZ); | ||
39 | size_t nBytes = file.gcount(); | ||
40 | - tmpOut.write(tmpBuffer, nBytes); | ||
41 | + tmpOut.write((char *)tmpBuffer, nBytes); | ||
42 | } | ||
43 | |||
44 | close(fd); //closes the file | ||
45 | |||
46 | -#endif ////((defined(__GNUC__) && __GNUC__ >= 3 ) || !defined(HAVE_MKSTEMP)) | ||
47 | +#endif ////!defined(HAVE_MKSTEMP) | ||
48 | |||
49 | tmpOut.close(); | ||
50 | file.close(); |