Skip to content

Commit

Permalink
ExternalCommandListener: Fix crash when reading from socket
Browse files Browse the repository at this point in the history
refs #10700
  • Loading branch information
Michael Friedrich authored and gunnarbeutner committed Feb 23, 2016
1 parent ec9caa4 commit 0516cb5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/compat/externalcommandlistener.cpp
Expand Up @@ -110,7 +110,16 @@ void ExternalCommandListener::CommandPipeThread(const String& commandPath)
sock->Poll(true, false);

char buffer[8192];
size_t rc = sock->Read(buffer, sizeof(buffer));
size_t rc;

try {
rc = sock->Read(buffer, sizeof(buffer));
} catch (const std::exception& ex) {
Log(LogWarning, "ExternalCommandListener")
<< "Cannot read from socket." << DiagnosticInformation(ex);
break;
}

if (rc <= 0)
break;

Expand Down

0 comments on commit 0516cb5

Please sign in to comment.