]> granicus.if.org Git - icinga2/commitdiff
Fix crash without CORS config settings 6174/head
authorMichael Friedrich <michael.friedrich@icinga.com>
Wed, 21 Mar 2018 19:41:52 +0000 (20:41 +0100)
committerMichael Friedrich <michael.friedrich@icinga.com>
Wed, 21 Mar 2018 19:42:31 +0000 (20:42 +0100)
fixes #6173
refs #6098

lib/remote/httpserverconnection.cpp

index 1592e3839520bf96ccea00a68f3ecad31f614b0c..6e8ea1c5839143de926ca29664fdefb7f98f019e 100644 (file)
@@ -214,7 +214,7 @@ bool HttpServerConnection::ManageHeaders(HttpResponse& response)
 
        Array::Ptr headerAllowOrigin = listener->GetAccessControlAllowOrigin();
 
-       if (headerAllowOrigin->GetLength() != 0) {
+       if (headerAllowOrigin && headerAllowOrigin->GetLength() != 0) {
                String origin = m_CurrentRequest.Headers->Get("origin");
                {
                        ObjectLock olock(headerAllowOrigin);