aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-01-26 20:20:59 +0000
committerEric Wong <normalperson@yhbt.net>2008-01-26 20:20:59 +0000
commit29df70366c807a671611720ad0419c6da1ac0e41 (patch)
tree61e2975a336efb2a1f76d7bacd42afe278252692 /src/playlist.c
parent3a1b3e3807609434bf3f392b6b1f66ac218e265c (diff)
downloadmpd-29df70366c807a671611720ad0419c6da1ac0e41.tar.gz
mpd-29df70366c807a671611720ad0419c6da1ac0e41.tar.xz
mpd-29df70366c807a671611720ad0419c6da1ac0e41.zip
storedPlaylist: prevent potential DoS from stored playlist commands
While mpd has always protected against the infinite expansion of the main playlist by limiting its size in memory, however the new storedPlaylist code has never checked for this limit. Malicious (or clumsy) users could repeatedly append songs to stored playlists, causing files to grow increasingly large on disk. Attempting to load extremely large files into memory will require mpd to slurp that all into memory, and ultimately the file would be unusable by mpd because of the configurable playlist size limit. Now we limit stored playlists to the max_playlist_length configuration variable set by the user (default is 16384). We will refuse to append to playlist files if they hit that limit; and also refuse to load more than the specified amount of songs into memory. git-svn-id: https://svn.musicpd.org/mpd/trunk@7154 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/playlist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/playlist.c b/src/playlist.c
index 0f76c49a0..e67fb9430 100644
--- a/src/playlist.c
+++ b/src/playlist.c
@@ -58,7 +58,7 @@
static Playlist playlist;
static int playlist_state = PLAYLIST_STATE_STOP;
-static int playlist_max_length = DEFAULT_PLAYLIST_MAX_LENGTH;
+int playlist_max_length = DEFAULT_PLAYLIST_MAX_LENGTH;
static int playlist_stopOnError;
static int playlist_errorCount;
static int playlist_queueError;