Commit 481a96ec authored by Warren Dukes's avatar Warren Dukes

#1) Fix a potential security hole, where mpd sends a line from a playlist to a…

#1) Fix a potential security hole, where mpd sends a line from a playlist to a client if the line is too long. But this is a rare circumstance, since the file would need to have a .m3u suffix and the line would need to be very long. #2) Fix qball's bug, basically when we try todo initial buffering in decodeStart(), sleep for a few seconds after each attempt to finish init'ing the connection and begin buffering. git-svn-id: https://svn.musicpd.org/mpd/trunk@2236 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent c0e0c246
......@@ -286,7 +286,11 @@ void decodeStart(PlayerControl * pc, OutputBuffer * cb, DecoderControl * dc) {
dc->start = 0;
while(!inputStreamAtEOF(&inStream) && bufferInputStream(&inStream) < 0
&& !dc->stop);
&& !dc->stop)
{
/* sleep so we don't consume 100% of the cpu */
my_usleep(1000);
}
if(dc->stop) {
dc->state = DECODE_STATE_STOP;
......
......@@ -1398,7 +1398,9 @@ int loadPlaylist(FILE * fp, char * utf8file) {
else if(slength==MAXPATHLEN) {
s[slength] = '\0';
commandError(fp, ACK_ERROR_PLAYLIST_LOAD,
"\"%s\" too long", s);
"line in \"%s\" is too long", utf8file);
ERROR("line \"%s\" in playlist \"%s\" is too long\n",
s, utf8file);
while(fclose(fileP) && errno==EINTR);
if(erroredFile) free(erroredFile);
return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment