-
-
Notifications
You must be signed in to change notification settings - Fork 804
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request from GHSA-6r8q-pfpv-7cgj
for loops of the form `for i in range(x, x+N)`, the range of the iterator is not checked, leading to potential overflow. the following example demonstrates the potential for overflow: ``` @external def test() -> uint16: x:uint8 = 255 a:uint8 = 0 for i in range(x, x+2): a = i return convert(a,uint16) # returns 256 ``` this commit fixes the issue by adding a range check before entering the loop body.
- Loading branch information
1 parent
4f8289a
commit 3de1415
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters