Code

mpdclient: fix crash after "clear" command
authorMax Kellermann <max@duempel.org>
Wed, 20 Jul 2011 18:47:23 +0000 (20:47 +0200)
committerMax Kellermann <max@duempel.org>
Wed, 20 Jul 2011 18:47:23 +0000 (20:47 +0200)
mpdclient_cmd_clear() calls playlist_clear(), which leaves a freed
pointer in c->song.  c->song is now cleared, too.

NEWS
src/mpdclient.c

diff --git a/NEWS b/NEWS
index 49693f2afa81301cff1b10253e40b7c098ce2a99..b3cf9003010fd3786fc74f828552f84a7b762f1d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,7 @@
 ncmpc 0.19 - not yet released
 * require libmpdclient 2.2
 * show real server address in status message
+* fix crash after "clear" command
 
 
 ncmpc 0.18 - (09/22/2010)
index 7bf29ea921e20dbda7aae906e7754aaf979e1f20..59b0ad45ff504c8c47959e708220747b2b50b907 100644 (file)
@@ -348,6 +348,7 @@ mpdclient_cmd_clear(struct mpdclient *c)
                   reducing the UI latency */
                playlist_clear(&c->playlist);
                c->playlist.version = mpd_status_get_queue_version(status);
+               c->song = NULL;
        }
 
        c->events |= MPD_IDLE_QUEUE;