Mercurial > mplayer.hg
comparison stream/stream_cddb.c @ 25776:cf1d3164d30c
Make sure we do not write the terminating 0 out of bounds
author | reimar |
---|---|
date | Sat, 19 Jan 2008 16:33:06 +0000 |
parents | 454ab8a40f1c |
children | 1d16b891d440 |
comparison
equal
deleted
inserted
replaced
25775:7a0bcfc36766 | 25776:cf1d3164d30c |
---|---|
453 if( http_hdr->body_size<(unsigned int)(ptr2-ptr) ) { | 453 if( http_hdr->body_size<(unsigned int)(ptr2-ptr) ) { |
454 mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MPDEMUX_CDDB_UnexpectedFIXME); | 454 mp_msg(MSGT_DEMUX, MSGL_ERR, MSGTR_MPDEMUX_CDDB_UnexpectedFIXME); |
455 return -1; | 455 return -1; |
456 } | 456 } |
457 cddb_data->xmcd_file = ptr; | 457 cddb_data->xmcd_file = ptr; |
458 cddb_data->xmcd_file_size = ptr2-ptr+2; | 458 cddb_data->xmcd_file_size = ptr2-ptr; |
459 cddb_data->xmcd_file[cddb_data->xmcd_file_size] = '\0'; | 459 cddb_data->xmcd_file[cddb_data->xmcd_file_size] = '\0'; |
460 // Avoid the http_free function to free the xmcd file...save a mempcy... | 460 // Avoid the http_free function to free the xmcd file...save a mempcy... |
461 http_hdr->body = NULL; | 461 http_hdr->body = NULL; |
462 http_hdr->body_size = 0; | 462 http_hdr->body_size = 0; |
463 return cddb_write_cache(cddb_data); | 463 return cddb_write_cache(cddb_data); |