]> granicus.if.org Git - icinga2/commitdiff
Fix crash with anonymous clients on certificate signing request and storing sent... 6085/head
authorMichael Friedrich <michael.friedrich@icinga.com>
Fri, 9 Feb 2018 16:18:20 +0000 (17:18 +0100)
committerMichael Friedrich <michael.friedrich@icinga.com>
Fri, 9 Feb 2018 16:18:20 +0000 (17:18 +0100)
refs #5753

lib/remote/jsonrpcconnection.cpp

index af7c9f219ce04bf84f4670fde44e4192827a0af6..574cb007fb49c9e654fa18ea5c8316e7ba6da094 100644 (file)
@@ -114,10 +114,15 @@ void JsonRpcConnection::SendMessage(const Dictionary::Ptr& message)
 {
        try {
                ObjectLock olock(m_Stream);
+
                if (m_Stream->IsEof())
                        return;
+
                size_t bytesSent = JsonRpc::SendMessage(m_Stream, message);
-               m_Endpoint->AddMessageSent(bytesSent);
+
+               if (m_Endpoint)
+                       m_Endpoint->AddMessageSent(bytesSent);
+
        } catch (const std::exception& ex) {
                std::ostringstream info;
                info << "Error while sending JSON-RPC message for identity '" << m_Identity << "'";