Contents of /trunk/kaffeine/patches/kaffeine-0.7.x-CVE-2006-0051.patch
Parent Directory
|
Revision Log
Revision 144 -
(show annotations)
(download)
Tue May 8 20:06:05 2007 UTC (17 years ago) by niro
File size: 2802 byte(s)
Tue May 8 20:06:05 2007 UTC (17 years ago) by niro
File size: 2802 byte(s)
-import
1 | --- kaffeine/player-parts/Makefile.am |
2 | +++ kaffeine/player-parts/Makefile.am |
3 | @@ -12,10 +12,8 @@ |
4 | kaffeineincludedir = $(includedir)/kaffeine |
5 | kaffeineinclude_HEADERS = mrl.h kmediapart.h playlistimport.h |
6 | |
7 | -noinst_HEADERS = http.h |
8 | - |
9 | METASOURCES = AUTO |
10 | |
11 | -libkmediapart_la_SOURCES = mrl.cpp kmediapart.cpp playlistimport.cpp http.c |
12 | +libkmediapart_la_SOURCES = mrl.cpp kmediapart.cpp playlistimport.cpp |
13 | libkmediapart_la_LIBADD = $(LIB_KPARTS) |
14 | libkmediapart_la_LDFLAGS = $(all_libraries) -version-info 0:1:0 -no-undefined |
15 | --- kaffeine/player-parts/playlistimport.cpp |
16 | +++ kaffeine/player-parts/playlistimport.cpp |
17 | @@ -34,7 +34,6 @@ |
18 | #include <qregexp.h> |
19 | |
20 | #include "mrl.h" |
21 | -#include "http.h" |
22 | |
23 | #include "playlistimport.h" |
24 | |
25 | @@ -430,57 +429,21 @@ |
26 | |
27 | bool PlaylistImport::ram(const MRL& playlist, MRL::List& mrls, QWidget* parent) |
28 | { |
29 | - kdDebug() << "PlaylistImport: ram: " << playlist.url() << endl; |
30 | - Q_ULONG result; |
31 | - char buf[10]; |
32 | - char mime[1024]; |
33 | + kdDebug() << "PlaylistImport: ram: " << playlist.url() << endl; |
34 | |
35 | - if (playlist.kurl().isLocalFile()) |
36 | - { |
37 | - QFile file(playlist.kurl().path()); |
38 | - if (!file.open(IO_ReadOnly)) |
39 | - { |
40 | - kdError() << "PlaylistImport: Can't open " << playlist.url() << endl; |
41 | - return false; |
42 | - } |
43 | - result = file.readBlock(buf, 4); |
44 | - file.close(); |
45 | - if (result != 4) |
46 | - { |
47 | - kdError() << "PlaylistImport: Can't read " << playlist.url() << endl; |
48 | - return false; |
49 | - } |
50 | - } |
51 | - else |
52 | - { |
53 | - if (playlist.kurl().protocol() == "http") |
54 | - { |
55 | - |
56 | - result = http_peek(playlist.url(), 4, buf, mime); |
57 | - |
58 | - if (result <= 0) |
59 | - { |
60 | - kdError() << "Can't open " << playlist.url() << endl; |
61 | - return false; |
62 | - } |
63 | - } |
64 | - else |
65 | - { |
66 | - kdError() << "PlaylistImport: ram: Download via " << playlist.kurl().protocol() << |
67 | - " protocol not supported." << endl; |
68 | - return false; |
69 | - } |
70 | - } |
71 | - |
72 | - if (buf[0]=='.' && buf[1]=='R' && buf[2]=='M' && buf[3]=='F') |
73 | - { |
74 | - kdDebug() << "PlaylistImport: Seems to be a real media file" << endl; |
75 | - return false; |
76 | - } |
77 | - |
78 | - kdDebug() << "PlaylistImport: Seems to be a ram playlist!" << endl; |
79 | + if (!playlist.kurl().isLocalFile() && !playlist.kurl().protocol().startsWith("http")) { |
80 | + kdError() << "PlaylistImport: ram: Download via " << playlist.kurl().protocol() << " protocol not supported." << endl; |
81 | + return false; |
82 | + } |
83 | + |
84 | + kdDebug() << "PlaylistImport: Seems to be a ram playlist!" << endl; |
85 | + |
86 | + QString localFile, url; |
87 | + if (KIO::NetAccess::mimetype(playlist.kurl(), parent) == "application/vnd.rn-realmedia") { |
88 | + kdDebug() << "PlaylistImport: Seems to be a real media file" << endl; |
89 | + return false; |
90 | + } |
91 | |
92 | - QString localFile, url; |
93 | if (KIO::NetAccess::download(playlist.kurl(), localFile, parent)) |
94 | { |
95 | QFile plFile(localFile); |