From dc3624945fc22551d9478f59aae26debb2f34ec1 Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 23 Dec 2019 11:52:32 +0100 Subject: [PATCH] fixed uninitialized memory read and inconsistent initialization of mReputationScore in GxsReputation --- libretroshare/src/services/p3gxsreputation.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/libretroshare/src/services/p3gxsreputation.h b/libretroshare/src/services/p3gxsreputation.h index e9a14d4e7..2045e6f05 100644 --- a/libretroshare/src/services/p3gxsreputation.h +++ b/libretroshare/src/services/p3gxsreputation.h @@ -65,12 +65,14 @@ class Reputation { public: Reputation() : - mOwnOpinion(static_cast(RsOpinion::NEUTRAL)), mOwnOpinionTs(0), + mOwnOpinion(static_cast(RsOpinion::NEUTRAL)), + mOwnOpinionTs(0), mFriendAverage(1.0f), - /* G10h4ck: TODO shouln't this be initialized with - * RsReputation::NEUTRAL or UNKOWN? */ - mReputationScore(static_cast(RsOpinion::NEUTRAL)), - mIdentityFlags(0) {} + mFriendsPositive(0), + mFriendsNegative(0), + mReputationScore(1.0f), + mIdentityFlags(0), + mLastUsedTS(0) {} void updateReputation();