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

panic while fuzzing #371

Closed
CleveGreen opened this issue Mar 18, 2024 · 1 comment · Fixed by #372
Closed

panic while fuzzing #371

CleveGreen opened this issue Mar 18, 2024 · 1 comment · Fixed by #372

Comments

@CleveGreen
Copy link

Please update line 114 of numberparse/correct.rs to wrapping add, this kept all tests passing plus eliminated the panic while fuzzing.

            while is_integer(get!(buf, idx)) {
                num = 10_u64.wrapping_mul(num) + u64::from(get!(buf, idx) - b'0');
                idx += 1;
            }

to this:

            while is_integer(get!(buf, idx)) {
                num = 10_u64.wrapping_mul(num).wrapping_add(u64::from(get!(buf, idx) - b'0'));
                idx += 1;
            }
Licenser added a commit that referenced this issue Mar 20, 2024
@Licenser Licenser linked a pull request Mar 20, 2024 that will close this issue
@Licenser
Copy link
Member

Thanks, good catch 👍

Licenser added a commit that referenced this issue Mar 20, 2024
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

Successfully merging a pull request may close this issue.

2 participants