From a79368be2188230ebcf3d5b9ca83db4345afdcf0 Mon Sep 17 00:00:00 2001 From: div72 Date: Sun, 24 Dec 2023 22:59:20 +0300 Subject: [PATCH] mrc: zero initialize primitives Rationale: Avoids an UB in it_rejects_invalid_claims MRC test. --- src/gridcoin/mrc.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gridcoin/mrc.h b/src/gridcoin/mrc.h index bcc966d036..578c631302 100644 --- a/src/gridcoin/mrc.h +++ b/src/gridcoin/mrc.h @@ -125,14 +125,14 @@ class MRC : public IContractPayload //! incoming reward claims and can index those calculated values without //! this field. It can be considered informational. //! - CAmount m_research_subsidy; + CAmount m_research_subsidy = 0; //! //! \brief The value of the fees charged to the MRC claimant. These will be //! subtracted from the research subsidy and distributed to the staker and //! the foundation according to protocol rules encapsulated in ComputeMRCFee(). //! - CAmount m_fee; + CAmount m_fee = 0; //! //! \brief The researcher magnitude value from the superblock at the time @@ -145,14 +145,14 @@ class MRC : public IContractPayload //! //! Previous protocol versions used the magnitude in reward calculations. //! - uint16_t m_magnitude; + uint16_t m_magnitude = 0; //! //! \brief The magnitude ratio of the network at the time of the claim. //! //! Informational. //! - double m_magnitude_unit; + double m_magnitude_unit = 0.0; //! //! \brief The hash of the last block (head of the chain) for the MRC