diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index 19060a3..68743f0 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -707,6 +707,13 @@ the file that is being played. May be dangerous if playing from untrusted media. . .TP +.B \-unsafe-playlists +Enables playlist parsing and handling code that has not been checked to be +exploit-free. +Since currently arbitrary URLs are allowed in playlists, all playlist code is +considered unsafe for now. +. +.TP .B "\-v\ \ \ \ \ " Increment verbosity level, one level for each \-v found on the command line. diff --git a/cfg-mplayer.h b/cfg-mplayer.h index b1d2442..87ee6fc 100644 --- a/cfg-mplayer.h +++ b/cfg-mplayer.h @@ -261,6 +261,8 @@ m_option_t mplayer_opts[]={ {"use-filedir-conf", &use_filedir_conf, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, {"nouse-filedir-conf", &use_filedir_conf, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, + {"unsafe-playlists", &unsafe_playlists, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, + {"nounsafe-playlists", &unsafe_playlists, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, #ifdef CRASH_DEBUG {"crash-debug", &crash_debug, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, {"nocrash-debug", &crash_debug, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, diff --git a/mplayer.c b/mplayer.c index c0ca8d5..2c85318 100644 --- a/mplayer.c +++ b/mplayer.c @@ -84,6 +84,7 @@ int slave_mode=0; int player_idle_mode=0; int quiet=0; int enable_mouse_movements=0; +int unsafe_playlists; #ifdef WIN32 char * proc_priority=NULL; @@ -2862,7 +2863,7 @@ if (edl_output_filename) { if ( use_gui ) guiGetEvent( guiSetStream,(char *)mpctx->stream ); #endif - if(mpctx->file_format == DEMUXER_TYPE_PLAYLIST) { + if(unsafe_playlists && mpctx->file_format == DEMUXER_TYPE_PLAYLIST) { play_tree_t* entry; // Handle playlist current_module="handle_playlist"; @@ -2950,7 +2951,7 @@ mpctx->demuxer=demux_open(mpctx->stream,mpctx->file_format,audio_id,video_id,dvd // HACK to get MOV Reference Files working -if (mpctx->demuxer && mpctx->demuxer->type==DEMUXER_TYPE_PLAYLIST) +if (unsafe_playlists && mpctx->demuxer && mpctx->demuxer->type==DEMUXER_TYPE_PLAYLIST) { unsigned char* playlist_entry; play_tree_t *list = NULL, *entry = NULL;