summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9f5977b)
raw | patch | inline | side by side (parent: 9f5977b)
author | Max Kellermann <max@duempel.org> | |
Sat, 19 Jun 2010 11:05:02 +0000 (13:05 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Sat, 19 Jun 2010 11:05:02 +0000 (13:05 +0200) |
The function enqueue_and_play() may cause an assertion failure,
because it evaluates the filelist_entry object after
mpdclient_get_connection() call. However, mpdclient_get_connection() may
indirectly invalidate the filelist_entry object, when it sees that the
connection has become invalid; it will return a NULL connection then.
This results in an assertion failure or a segmentation fault.
because it evaluates the filelist_entry object after
mpdclient_get_connection() call. However, mpdclient_get_connection() may
indirectly invalidate the filelist_entry object, when it sees that the
connection has become invalid; it will return a NULL connection then.
This results in an assertion failure or a segmentation fault.
NEWS | patch | blob | history | |
src/screen_browser.c | patch | blob | history |
index b93ea55c9190513a8d24ec69230811a7c4950a99..526570db44ed56a6ca7f085086549843a4ed7dff 100644 (file)
--- a/NEWS
+++ b/NEWS
ncmpc 0.17 - not yet released
* screen_queue: fix range selection check on "shuffle"
+* screen_browser: check for error before adding song to playlist
* po: added Brazilian Portuguese translation
diff --git a/src/screen_browser.c b/src/screen_browser.c
index 45e11ebcfb4ca679345152cb445822606848c3db..04673f4e85a7e5632525a3cf19820fcab1d80ad6 100644 (file)
--- a/src/screen_browser.c
+++ b/src/screen_browser.c
enqueue_and_play(struct mpdclient *c, struct filelist_entry *entry)
{
struct mpd_connection *connection = mpdclient_get_connection(c);
+ if (connection == NULL)
+ return false;
+
const struct mpd_song *song = mpd_entity_get_song(entry->entity);
int id;