diff --git a/arangod/VocBase/AuthInfo.cpp b/arangod/VocBase/AuthInfo.cpp index 9eef6903bd..2a7fa4cd56 100644 --- a/arangod/VocBase/AuthInfo.cpp +++ b/arangod/VocBase/AuthInfo.cpp @@ -345,7 +345,7 @@ HexHashResult AuthInfo::hexHashFromData(std::string const& hashMethod, char cons } if (crypted == nullptr || - cryptedLength <= 0) { + cryptedLength == 0) { delete[] crypted; return HexHashResult(TRI_ERROR_OUT_OF_MEMORY); } diff --git a/arangod/VocBase/AuthInfo.h b/arangod/VocBase/AuthInfo.h index 222d11127a..2448fdc920 100644 --- a/arangod/VocBase/AuthInfo.h +++ b/arangod/VocBase/AuthInfo.h @@ -54,8 +54,8 @@ enum class AuthSource { class HexHashResult : public arangodb::Result { public: - HexHashResult(int errorNumber) : Result(errorNumber) {} - HexHashResult(std::string const& hexHash) : Result(0), _hexHash(hexHash) {} + explicit HexHashResult(int errorNumber) : Result(errorNumber) {} + explicit HexHashResult(std::string const& hexHash) : Result(0), _hexHash(hexHash) {} std::string const& hexHash() { return _hexHash; } protected: @@ -64,7 +64,12 @@ class HexHashResult : public arangodb::Result { class AuthEntry { public: - AuthEntry() : _active(false), _mustChange(false), _allDatabases(AuthLevel::NONE) {} + AuthEntry() + : _active(false), + _mustChange(false), + _created(TRI_microtime()), + _source(AuthSource::COLLECTION), + _allDatabases(AuthLevel::NONE) {} AuthEntry(std::string&& username, std::string&& passwordMethod, std::string&& passwordSalt, std::string&& passwordHash,