code-423n4 / 2023-06-stader-findings

1 stars 1 forks source link

Upgraded Q -> 2 from #130 [1686726021314] #427

Closed c4-judge closed 1 year ago

c4-judge commented 1 year ago

Judge has assessed an item in Issue #130 as 2 risk. The relevant finding follows:

Possible Infinite Loops If the condition triggers the continue, then the loop variable does not get incremented. The condition never changes, as the same condition is checked over and over again, resulting in an infinite loop.

File: contracts/PermissionedNodeRegistry.sol

207: if (!operatorStructById[i].active) { 208: continue; 209: } Link: https://github.com/code-423n4/2023-06-stader/blob/main/contracts/PermissionedNodeRegistry.sol#L207-L209

Fix: Reverse the condition and put everything inside the if block. Keep i++ outside the if block.

File: contracts/PermissionedNodeRegistry.sol

227: if (!operatorStructById[i].active) { 228: continue; 229: } https://github.com/code-423n4/2023-06-stader/blob/main/contracts/PermissionedNodeRegistry.sol#L227-L229

c4-judge commented 1 year ago

Picodes marked the issue as duplicate of #155

c4-judge commented 1 year ago

Picodes marked the issue as unsatisfactory: Out of scope