diff mplayer.c @ 36146:5950fc0d4b53

Allow parsing arbitrary files as playlist only if explicitly enabled.
author reimar
date Sun, 05 May 2013 17:02:33 +0000
parents 1562f350e8d2
children 428bd1b127bd
line wrap: on
line diff
--- a/mplayer.c	Sun May 05 17:02:31 2013 +0000
+++ b/mplayer.c	Sun May 05 17:02:33 2013 +0000
@@ -330,6 +330,8 @@
 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 @@
         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;