Skip to content

Commit

Permalink
Fix UB in CDKGSessionHandler::SleepBeforePhase.
Browse files Browse the repository at this point in the history
  • Loading branch information
sproxet committed Sep 22, 2022
1 parent a8dcd7f commit 75effb4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/llmq/quorums_dkgsessionhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ void CDKGSessionHandler::SleepBeforePhase(QuorumPhase curPhase,
phaseTime = 0;
}

int64_t sleepTime = (int64_t)(phaseTime * curSession->GetMyMemberIndex());
int64_t sleepTime = 0;
if (curSession->GetMyMemberIndex() != UINT64_MAX) sleepTime = (int64_t)(phaseTime * curSession->GetMyMemberIndex());
int64_t endTime = GetTimeMillis() + sleepTime;
while (GetTimeMillis() < endTime) {
if (stopRequested || ShutdownRequested()) {
Expand Down

0 comments on commit 75effb4

Please sign in to comment.