]> granicus.if.org Git - icinga2/commitdiff
Fix crash when using incorrectly formatted password hash
authorJean Flach <jean-marcel.flach@icinga.com>
Fri, 22 Dec 2017 11:58:39 +0000 (12:58 +0100)
committerJean Flach <jean-marcel.flach@icinga.com>
Fri, 23 Feb 2018 12:07:55 +0000 (13:07 +0100)
lib/remote/apiuser.cpp

index 0caac19ff396781e9f9665727c5847b8b1e0216d..606e66dcc69bff0a741dbaaf8ab1d9d400169445 100644 (file)
@@ -69,7 +69,7 @@ ApiUser::Ptr ApiUser::GetByAuthHeader(const String& auth_header)
                return nullptr;
        else {
                Dictionary::Ptr passwordDict = user->GetPasswordDict();
-               if (!ComparePassword(passwordDict->Get("password"), password, passwordDict->Get("salt")))
+               if (!passwordDict || !ComparePassword(passwordDict->Get("password"), password, passwordDict->Get("salt")))
                        return nullptr;
        }