mirror of https://github.com/Icinga/icinga2.git
Fix crash when using incorrectly formatted password hash
This commit is contained in:
parent
6387f5442e
commit
2e5aedd28a
|
@ -69,7 +69,7 @@ ApiUser::Ptr ApiUser::GetByAuthHeader(const String& auth_header)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
else {
|
else {
|
||||||
Dictionary::Ptr passwordDict = user->GetPasswordDict();
|
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;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue