summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a6df916)
raw | patch | inline | side by side (parent: a6df916)
author | Max Kellermann <max@duempel.org> | |
Sun, 21 Sep 2008 20:43:57 +0000 (22:43 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Sun, 21 Sep 2008 20:43:57 +0000 (22:43 +0200) |
Check if connection->sock is valid in mpd_executeCommand().
src/libmpdclient.c | patch | blob | history |
diff --git a/src/libmpdclient.c b/src/libmpdclient.c
index 2b4a52c85458a348826a3f6743cf9714cd6cdf6d..dfca0a347a0ae5b0de341f3ba214580427b056fe 100644 (file)
--- a/src/libmpdclient.c
+++ b/src/libmpdclient.c
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");