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 Jul 31, 2022
1 parent 0f3ad4c commit 3546005
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 3546005

Please sign in to comment.