aboutsummaryrefslogtreecommitdiffstats
path: root/src/screen_file.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-09-18 01:15:20 +0200
committerMax Kellermann <max@duempel.org>2008-09-18 01:15:20 +0200
commite54533bd1fad95b149e87918dffca06b0afb5074 (patch)
tree0f19423193242a63350539812d99120176f3f982 /src/screen_file.c
parent9de9dfc3a6a8061089eebcc6271b2f13ac43e20b (diff)
downloadmpd-e54533bd1fad95b149e87918dffca06b0afb5074.tar.gz
mpd-e54533bd1fad95b149e87918dffca06b0afb5074.tar.xz
mpd-e54533bd1fad95b149e87918dffca06b0afb5074.zip
screen: check MPD status only if connected
Fix several segmentation faults: when the connection to the MPD server is lost, there were NULL pointer dereferences because client->status==NULL. Check before accessing it.
Diffstat (limited to '')
-rw-r--r--src/screen_file.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/screen_file.c b/src/screen_file.c
index 7465ff125..92d89232b 100644
--- a/src/screen_file.c
+++ b/src/screen_file.c
@@ -706,6 +706,9 @@ browse_cmd(screen_t *screen, mpdclient_t *c, command_t cmd)
screen_status_printf(_("Screen updated!"));
return 1;
case CMD_DB_UPDATE:
+ if (c->status == NULL)
+ return 1;
+
if( !c->status->updatingDb )
{
if( mpdclient_cmd_db_update_utf8(c,filelist->path)==0 )