Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential wrapping add #44

Open
mooman219 opened this issue Sep 10, 2019 · 0 comments
Open

Potential wrapping add #44

mooman219 opened this issue Sep 10, 2019 · 0 comments

Comments

@mooman219
Copy link

self.a[linestart + x0i as usize] += d * a0;

x0i can be -1 in this case, and casting it to usize will give usize max. The addition with linestart will cause an arithmetic overflow. Wrapping add should be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant