Skip to content

Commit ba15d56

Browse files
authored
Merge pull request ethereum#60 from kroggen/patch-1
Fix overflow on Memory.copy when len%32==0
2 parents 4e5f1f3 + 82a5397 commit ba15d56

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/unsafe/Memory.sol

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ library Memory {
6464
src += WORD_SIZE;
6565
}
6666

67+
if (len == 0) return;
68+
6769
// Copy remaining bytes
6870
uint mask = 256 ** (WORD_SIZE - len) - 1;
6971
assembly {

0 commit comments

Comments
 (0)