fixed uninitialized memory read and inconsistent initialization of mReputationScore in GxsReputation

This commit is contained in:
csoler 2019-12-23 11:52:32 +01:00
parent 71149935f9
commit dc3624945f
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C

View File

@ -65,12 +65,14 @@ class Reputation
{
public:
Reputation() :
mOwnOpinion(static_cast<int32_t>(RsOpinion::NEUTRAL)), mOwnOpinionTs(0),
mOwnOpinion(static_cast<int32_t>(RsOpinion::NEUTRAL)),
mOwnOpinionTs(0),
mFriendAverage(1.0f),
/* G10h4ck: TODO shouln't this be initialized with
* RsReputation::NEUTRAL or UNKOWN? */
mReputationScore(static_cast<float>(RsOpinion::NEUTRAL)),
mIdentityFlags(0) {}
mFriendsPositive(0),
mFriendsNegative(0),
mReputationScore(1.0f),
mIdentityFlags(0),
mLastUsedTS(0) {}
void updateReputation();