From: Jean Flach Date: Fri, 22 Dec 2017 11:58:39 +0000 (+0100) Subject: Fix crash when using incorrectly formatted password hash X-Git-Tag: v2.8.2~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2e5aedd28a5e98628febd0025291405ce4390189;p=icinga2 Fix crash when using incorrectly formatted password hash --- diff --git a/lib/remote/apiuser.cpp b/lib/remote/apiuser.cpp index 0caac19ff..606e66dcc 100644 --- a/lib/remote/apiuser.cpp +++ b/lib/remote/apiuser.cpp @@ -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; }