Livestatus: Fix invalid livestatus query crashes Icinga 2.

Fixes #5076
This commit is contained in:
Michael Friedrich 2013-11-15 10:56:14 +01:00
parent bc4c4098f0
commit e6128a0a96
2 changed files with 13 additions and 3 deletions

View File

@ -132,9 +132,17 @@ void LivestatusListener::ClientThreadProc(const Socket::Ptr& client)
break; break;
} }
try {
Query::Ptr query = make_shared<Query>(lines, GetCompatLogPath()); Query::Ptr query = make_shared<Query>(lines, GetCompatLogPath());
if (!query->Execute(stream)) if (!query->Execute(stream))
break; break;
} catch (const std::exception& ex) {
std::ostringstream info;
info << "Exception thrown while running livestatus query: " << std::endl
<< boost::diagnostic_information(ex);
Log(LogCritical, "livestatus", info.str());
return;
}
} }
{ {

View File

@ -0,0 +1,2 @@
D