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

Check lower bound returned by atoi() #1603

Merged

Conversation

garrettgu10
Copy link
Contributor

A potential negative value returned by atoi() may cause an excessive memory allocation. This PR adds a check that the returned value is nonnegative.

@garrettgu10 garrettgu10 requested review from a team as code owners February 1, 2024 16:19
@garrettgu10 garrettgu10 requested review from fhanau and jp4a50 February 1, 2024 16:19
@garrettgu10 garrettgu10 merged commit 84dfc6f into cloudflare:main Feb 1, 2024
11 checks passed
@kentonv
Copy link
Member

kentonv commented Feb 1, 2024

We should really remove the atoi() call entirely and instead use metadata.parseAs<uint>().

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 this pull request may close these issues.

3 participants