From 8c64749d62faa6ea99b44b57d44a33b744a649bc Mon Sep 17 00:00:00 2001 From: Richard Holland Date: Fri, 22 Dec 2023 12:39:00 +0000 Subject: [PATCH] change types on lambda to prevent any risk of overflow --- src/ripple/app/tx/impl/Import.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/ripple/app/tx/impl/Import.cpp b/src/ripple/app/tx/impl/Import.cpp index 6b4c335d4..d136c7d67 100644 --- a/src/ripple/app/tx/impl/Import.cpp +++ b/src/ripple/app/tx/impl/Import.cpp @@ -817,16 +817,17 @@ Import::preflight(PreflightContext const& ctx) << " validation count: " << validationCount; // check if the validation count is adequate - auto hasInsufficientQuorum = [&ctx](int quorum, int validationCount) { - if (ctx.rules.enabled(fixXahauV1)) - { - return quorum > validationCount; - } - else - { - return quorum >= validationCount; - } - }; + auto hasInsufficientQuorum = + [&ctx](uint64_t quorum, uint64_t validationCount) { + if (ctx.rules.enabled(fixXahauV1)) + { + return quorum > validationCount; + } + else + { + return quorum >= validationCount; + } + }; if (hasInsufficientQuorum(quorum, validationCount)) { JLOG(ctx.j.warn()) << "Import: xpop did not contain an 80% quorum for "