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

Implement checked::length_of #585

Closed
Tracked by #576
the-moisrex opened this issue Dec 29, 2024 · 1 comment
Closed
Tracked by #576

Implement checked::length_of #585

the-moisrex opened this issue Dec 29, 2024 · 1 comment
Assignees
Labels
Security Security Bug

Comments

@the-moisrex
Copy link
Owner

the-moisrex commented Dec 29, 2024

Memory dump:

After blowup:
   ed 94 81 ed   85 b2 ed 0a   00 ed 0a 00   ed 0a 00 00   │ ················ │ cur len: 3, new len: 1
                        ^ ^    ^
                       0,1 \   3
                            2

Seems like required_length_of is not safe and it checks only "ed" which is the length of 3, but
it does not check the next code unit and what not.

@the-moisrex
Copy link
Owner Author

Done; even though I don't like the implementation of the UTF-8 version, but I like what I did with the UTF-16 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Security Security Bug
Projects
Status: Done
Status: Done
Development

No branches or pull requests

1 participant