summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-06-05 11:13:32 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-06-05 11:13:32 +0000
commit9afe162ba43e43dd488c56b64bb8bd5015e012b3 (patch)
tree58ab981cd00d74d2e3595824589bc1f6fa50b50b /stream
parentf575084788c101393739ad354a992cb32cb6136d (diff)
downloadmpv-9afe162ba43e43dd488c56b64bb8bd5015e012b3.tar.bz2
mpv-9afe162ba43e43dd488c56b64bb8bd5015e012b3.tar.xz
Avoiding sscanf in cddb support reading more data with %s than buffer size
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23470 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r--stream/stream_cddb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/stream/stream_cddb.c b/stream/stream_cddb.c
index 9090a0d178..1679651bb0 100644
--- a/stream/stream_cddb.c
+++ b/stream/stream_cddb.c
@@ -377,7 +377,7 @@ cddb_read_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_data) {
switch(status) {
case 210:
- ret = sscanf( http_hdr->body, "%d %s %08lx", &status, category, &disc_id);
+ ret = sscanf( http_hdr->body, "%d %99s %08lx", &status, category, &disc_id);
if( ret!=3 ) {
mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_ParseError);
return -1;
@@ -438,7 +438,7 @@ cddb_parse_matches_list(HTTP_header_t *http_hdr, cddb_data_t *cddb_data) {
ptr++;
// We have a list of exact/inexact matches, so which one do we use?
// So let's take the first one.
- ret = sscanf(ptr, "%s %08lx %s", cddb_data->category, &(cddb_data->disc_id), album_title);
+ ret = sscanf(ptr, "%99s %08lx %99s", cddb_data->category, &(cddb_data->disc_id), album_title);
if( ret!=3 ) {
mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_ParseError);
return -1;
@@ -475,7 +475,7 @@ cddb_query_parse(HTTP_header_t *http_hdr, cddb_data_t *cddb_data) {
switch(status) {
case 200:
// Found exact match
- ret = sscanf(http_hdr->body, "%d %s %08lx %s", &status, cddb_data->category, &(cddb_data->disc_id), album_title);
+ ret = sscanf(http_hdr->body, "%d %99s %08lx %99s", &status, cddb_data->category, &(cddb_data->disc_id), album_title);
if( ret!=4 ) {
mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_ParseError);
return -1;