aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmpdclient.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-09-21 22:43:57 +0200
committerMax Kellermann <max@duempel.org>2008-09-21 22:43:57 +0200
commit54f4d47d8f0d4f7e0288a140c49b82999885e329 (patch)
tree1246c351d9280733796135746c4af99f3ac37bd9 /src/libmpdclient.c
parenta6df916494891d3dd7ab2262f1c74c6db4604c0c (diff)
downloadmpd-54f4d47d8f0d4f7e0288a140c49b82999885e329.tar.gz
mpd-54f4d47d8f0d4f7e0288a140c49b82999885e329.tar.xz
mpd-54f4d47d8f0d4f7e0288a140c49b82999885e329.zip
libmpdclient: added another connection->sock check
Check if connection->sock is valid in mpd_executeCommand().
Diffstat (limited to 'src/libmpdclient.c')
-rw-r--r--src/libmpdclient.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libmpdclient.c b/src/libmpdclient.c
index 2b4a52c85..dfca0a347 100644
--- a/src/libmpdclient.c
+++ b/src/libmpdclient.c
@@ -451,6 +451,12 @@ static void mpd_executeCommand(mpd_Connection *connection,
const char *commandPtr = command;
int commandLen = strlen(command);
+ if (connection->sock < 0) {
+ strcpy(connection->errorStr, "not connected");
+ connection->error = MPD_ERROR_CONNCLOSED;
+ return;
+ }
+
if (!connection->doneProcessing && !connection->commandList) {
strcpy(connection->errorStr,
"not done processing current command");