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

String.index_from (among others) is unsafe #173

Open
v-gb opened this issue Dec 18, 2024 · 0 comments
Open

String.index_from (among others) is unsafe #173

v-gb opened this issue Dec 18, 2024 · 0 comments
Labels
forwarded-to-js-devs This report has been forwarded to Jane Street's internal review system.

Comments

@v-gb
Copy link

v-gb commented Dec 18, 2024

This segfaults:

let _ = ignore (Base.String.index_from "" (-1000000000) 'c' : _ option)

Most other String.*index* functions are broken in this way, and also by accepting indices greater than the length of the string, whereas String.{r,}index_from_exn detect both kinds of bad inputs.

@github-iron github-iron added the forwarded-to-js-devs This report has been forwarded to Jane Street's internal review system. label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forwarded-to-js-devs This report has been forwarded to Jane Street's internal review system.
Projects
None yet
Development

No branches or pull requests

2 participants