Skip to content

Commit

Permalink
fix: Add missing zero length termination
Browse files Browse the repository at this point in the history
  • Loading branch information
QEDK committed Aug 11, 2022
1 parent baed24d commit 31dab1e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions contracts/lib/ExitPayloadReader.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ library ExitPayloadReader {
src += WORD_SIZE;
dest += WORD_SIZE;
}

if (len == 0) return;

// left over bytes. Mask is used to remove unwanted bytes from the word
uint256 mask = 256**(WORD_SIZE - len) - 1;
Expand Down

0 comments on commit 31dab1e

Please sign in to comment.