Contents of /trunk/mplayer/patches/mplayer-1.0_rc2-stream_cddb_fix_20080120.patch
Parent Directory | Revision Log
Revision 462 -
(show annotations)
(download)
Tue Feb 5 15:43:17 2008 UTC (16 years, 7 months ago) by niro
File size: 1018 byte(s)
Tue Feb 5 15:43:17 2008 UTC (16 years, 7 months ago) by niro
File size: 1018 byte(s)
-security fixes
1 | Index: stream_cddb.c |
2 | =================================================================== |
3 | --- stream_cddb.c (revision 24724) |
4 | +++ stream_cddb.c (working copy) |
5 | @@ -53,6 +53,7 @@ |
6 | #include "version.h" |
7 | #include "stream.h" |
8 | #include "network.h" |
9 | +#include "libavutil/intreadwrite.h" |
10 | |
11 | #define DEFAULT_FREEDB_SERVER "freedb.freedb.org" |
12 | #define DEFAULT_CACHE_DIR "/.cddb/" |
13 | @@ -453,8 +454,9 @@ |
14 | } else { |
15 | len = ptr2-ptr+1; |
16 | } |
17 | + len = FFMIN(sizeof(album_title) - 1, len); |
18 | strncpy(album_title, ptr, len); |
19 | - album_title[len-2]='\0'; |
20 | + album_title[len]='\0'; |
21 | } |
22 | mp_msg(MSGT_DEMUX, MSGL_STATUS, MSGTR_MPDEMUX_CDDB_ParseOKFoundAlbumTitle, album_title); |
23 | return 0; |
24 | @@ -490,8 +492,9 @@ |
25 | } else { |
26 | len = ptr2-ptr+1; |
27 | } |
28 | + len = FFMIN(sizeof(album_title) - 1, len); |
29 | strncpy(album_title, ptr, len); |
30 | - album_title[len-2]='\0'; |
31 | + album_title[len]='\0'; |
32 | } |
33 | mp_msg(MSGT_DEMUX, MSGL_STATUS, MSGTR_MPDEMUX_CDDB_ParseOKFoundAlbumTitle, album_title); |
34 | return cddb_request_titles(cddb_data); |