From 54f4d47d8f0d4f7e0288a140c49b82999885e329 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 21 Sep 2008 22:43:57 +0200 Subject: [PATCH] libmpdclient: added another connection->sock check Check if connection->sock is valid in mpd_executeCommand(). --- src/libmpdclient.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libmpdclient.c b/src/libmpdclient.c index 2b4a52c..dfca0a3 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"); -- 2.30.2