Fix crash when using incorrectly formatted password hash

This commit is contained in:
Jean Flach 2017-12-22 12:58:39 +01:00 committed by Gunnar Beutner
parent 65a806f5dc
commit df86245fe8
1 changed files with 1 additions and 1 deletions

View File

@ -162,7 +162,7 @@ void HttpServerConnection::ProcessMessageAsync(HttpRequest& request)
user.reset(); user.reset();
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")))
user.reset(); user.reset();
} }
} }