From d8b701c6195ad70e721167252767cdaacc95a7e6 Mon Sep 17 00:00:00 2001 From: sproxet Date: Sat, 30 Jul 2022 17:40:00 +0700 Subject: [PATCH] Fix UB in CQuorumBlockProcessor::GetCommitmentsFromBlock. --- src/llmq/quorums_blockprocessor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/llmq/quorums_blockprocessor.cpp b/src/llmq/quorums_blockprocessor.cpp index c24170c283..0f2fe3379e 100644 --- a/src/llmq/quorums_blockprocessor.cpp +++ b/src/llmq/quorums_blockprocessor.cpp @@ -321,7 +321,8 @@ bool CQuorumBlockProcessor::GetCommitmentsFromBlock(const CBlock& block, const C return state.DoS(100, false, REJECT_INVALID, "bad-qc-dup"); } - ret.emplace((Consensus::LLMQType)qc.commitment.llmqType, std::move(qc.commitment)); + auto temp = (Consensus::LLMQType) qc.commitment.llmqType; + ret.emplace(temp, qc.commitment); } }