[MPlayer-cvslog] r36240 - in trunk: DOCS/man/en/mplayer.1 cfg-mplayer.h mplayer.c

reimar subversion at mplayerhq.hu
Sun May 5 19:02:33 CEST 2013


Author: reimar
Date: Sun May  5 19:02:33 2013
New Revision: 36240

Log:
Allow parsing arbitrary files as playlist only
if explicitly enabled.

Modified:
   trunk/cfg-mplayer.h
   trunk/mplayer.c

Changes in other areas also in this revision:
Modified:
   trunk/DOCS/man/en/mplayer.1

Modified: trunk/cfg-mplayer.h
==============================================================================
--- trunk/cfg-mplayer.h	Sun May  5 19:02:31 2013	(r36239)
+++ trunk/cfg-mplayer.h	Sun May  5 19:02:33 2013	(r36240)
@@ -307,6 +307,8 @@ const m_option_t mplayer_opts[]={
 
     {"noloop", &mpctx_s.loop_times, CONF_TYPE_FLAG, 0, 0, -1, NULL},
     {"loop", &mpctx_s.loop_times, CONF_TYPE_INT, CONF_RANGE, -1, 10000, NULL},
+    {"allow-dangerous-playlist-parsing", &allow_playlist_parsing, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+    {"noallow-dangerous-playlist-parsing", &allow_playlist_parsing, CONF_TYPE_FLAG, 0, 1, 0, NULL},
     {"playlist", NULL, CONF_TYPE_STRING, CONF_NOCFG, 0, 0, NULL},
     {"shuffle", NULL, CONF_TYPE_FLAG, CONF_NOCFG, 0, 0, NULL},
     {"noshuffle", NULL, CONF_TYPE_FLAG, CONF_NOCFG, 0, 0, NULL},

Modified: trunk/mplayer.c
==============================================================================
--- trunk/mplayer.c	Sun May  5 19:02:31 2013	(r36239)
+++ trunk/mplayer.c	Sun May  5 19:02:33 2013	(r36240)
@@ -330,6 +330,8 @@ static char *prog_path;
 static int crash_debug;
 #endif
 
+static int allow_playlist_parsing;
+
 /* This header requires all the global variable declarations. */
 #include "cfg-mplayer.h"
 
@@ -3245,8 +3247,12 @@ play_next_file:
         current_module = "handle_playlist";
         mp_msg(MSGT_CPLAYER, MSGL_V, "Parsing playlist %s...\n",
                filename_recode(filename));
-        entry      = parse_playtree(mpctx->stream, use_gui);
-        mpctx->eof = playtree_add_playlist(entry);
+        if (allow_playlist_parsing) {
+            entry      = parse_playtree(mpctx->stream, use_gui);
+            mpctx->eof = playtree_add_playlist(entry);
+        } else {
+            mp_msg(MSGT_CPLAYER, MSGL_ERR, "Playlist parsing disabled for security reasons. Ignoring file.\n");
+        }
         goto goto_next_file;
     }
     mpctx->stream->start_pos += seek_to_byte;


More information about the MPlayer-cvslog mailing list