mirror of https://github.com/Icinga/icinga2.git
Fix nullptr deref in cluster events
This commit is contained in:
parent
3ba5090867
commit
71c420d501
|
@ -114,9 +114,6 @@ Value ClusterEvents::CheckResultAPIHandler(const MessageOrigin::Ptr& origin, con
|
|||
return Empty;
|
||||
}
|
||||
|
||||
if (!params)
|
||||
return Empty;
|
||||
|
||||
CheckResult::Ptr cr;
|
||||
Array::Ptr vperf;
|
||||
|
||||
|
@ -220,9 +217,6 @@ Value ClusterEvents::NextCheckChangedAPIHandler(const MessageOrigin::Ptr& origin
|
|||
return Empty;
|
||||
}
|
||||
|
||||
if (!params)
|
||||
return Empty;
|
||||
|
||||
Host::Ptr host = Host::GetByName(params->Get("host"));
|
||||
|
||||
if (!host)
|
||||
|
@ -284,9 +278,6 @@ Value ClusterEvents::NextNotificationChangedAPIHandler(const MessageOrigin::Ptr&
|
|||
return Empty;
|
||||
}
|
||||
|
||||
if (!params)
|
||||
return Empty;
|
||||
|
||||
Notification::Ptr notification = Notification::GetByName(params->Get("notification"));
|
||||
|
||||
if (!notification)
|
||||
|
@ -344,9 +335,6 @@ Value ClusterEvents::ForceNextCheckChangedAPIHandler(const MessageOrigin::Ptr& o
|
|||
return Empty;
|
||||
}
|
||||
|
||||
if (!params)
|
||||
return Empty;
|
||||
|
||||
Host::Ptr host = Host::GetByName(params->Get("host"));
|
||||
|
||||
if (!host)
|
||||
|
@ -409,9 +397,6 @@ Value ClusterEvents::ForceNextNotificationChangedAPIHandler(const MessageOrigin:
|
|||
return Empty;
|
||||
}
|
||||
|
||||
if (!params)
|
||||
return Empty;
|
||||
|
||||
Host::Ptr host = Host::GetByName(params->Get("host"));
|
||||
|
||||
if (!host)
|
||||
|
@ -480,9 +465,6 @@ Value ClusterEvents::AcknowledgementSetAPIHandler(const MessageOrigin::Ptr& orig
|
|||
return Empty;
|
||||
}
|
||||
|
||||
if (!params)
|
||||
return Empty;
|
||||
|
||||
Host::Ptr host = Host::GetByName(params->Get("host"));
|
||||
|
||||
if (!host)
|
||||
|
@ -546,9 +528,6 @@ Value ClusterEvents::AcknowledgementClearedAPIHandler(const MessageOrigin::Ptr&
|
|||
return Empty;
|
||||
}
|
||||
|
||||
if (!params)
|
||||
return Empty;
|
||||
|
||||
Host::Ptr host = Host::GetByName(params->Get("host"));
|
||||
|
||||
if (!host)
|
||||
|
@ -717,9 +696,6 @@ Value ClusterEvents::SendNotificationsAPIHandler(const MessageOrigin::Ptr& origi
|
|||
return Empty;
|
||||
}
|
||||
|
||||
if (!params)
|
||||
return Empty;
|
||||
|
||||
Host::Ptr host = Host::GetByName(params->Get("host"));
|
||||
|
||||
if (!host)
|
||||
|
@ -811,9 +787,6 @@ Value ClusterEvents::NotificationSentUserAPIHandler(const MessageOrigin::Ptr& or
|
|||
return Empty;
|
||||
}
|
||||
|
||||
if (!params)
|
||||
return Empty;
|
||||
|
||||
Host::Ptr host = Host::GetByName(params->Get("host"));
|
||||
|
||||
if (!host)
|
||||
|
@ -927,9 +900,6 @@ Value ClusterEvents::NotificationSentToAllUsersAPIHandler(const MessageOrigin::P
|
|||
return Empty;
|
||||
}
|
||||
|
||||
if (!params)
|
||||
return Empty;
|
||||
|
||||
Host::Ptr host = Host::GetByName(params->Get("host"));
|
||||
|
||||
if (!host)
|
||||
|
|
|
@ -40,9 +40,6 @@ REGISTER_APIFUNCTION(UpdateCertificate, pki, &UpdateCertificateHandler);
|
|||
|
||||
Value RequestCertificateHandler(const MessageOrigin::Ptr& origin, const Dictionary::Ptr& params)
|
||||
{
|
||||
if (!params)
|
||||
return Empty;
|
||||
|
||||
String certText = params->Get("cert_request");
|
||||
|
||||
boost::shared_ptr<X509> cert;
|
||||
|
|
|
@ -212,7 +212,11 @@ void JsonRpcConnection::MessageHandler(const String& jsonString)
|
|||
Log(LogNotice, "JsonRpcConnection")
|
||||
<< "Call to non-existent function '" << method << "' from endpoint '" << m_Identity << "'.";
|
||||
} else {
|
||||
resultMessage->Set("result", afunc->Invoke(origin, message->Get("params")));
|
||||
Dictionary::Ptr params = message->Get("params");
|
||||
if (params)
|
||||
resultMessage->Set("result", afunc->Invoke(origin, params));
|
||||
else
|
||||
resultMessage->Set("result", Empty);
|
||||
}
|
||||
} catch (const std::exception& ex) {
|
||||
/* TODO: Add a user readable error message for the remote caller */
|
||||
|
@ -274,9 +278,6 @@ void JsonRpcConnection::DataAvailableHandler(void)
|
|||
|
||||
Value SetLogPositionHandler(const MessageOrigin::Ptr& origin, const Dictionary::Ptr& params)
|
||||
{
|
||||
if (!params)
|
||||
return Empty;
|
||||
|
||||
double log_position = params->Get("log_position");
|
||||
Endpoint::Ptr endpoint = origin->FromClient->GetEndpoint();
|
||||
|
||||
|
|
Loading…
Reference in New Issue