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

Length check based on String.lenght/1 is not safe for info_hash #40

Open
mogeko opened this issue Jan 6, 2023 · 0 comments
Open

Length check based on String.lenght/1 is not safe for info_hash #40

mogeko opened this issue Jan 6, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@mogeko
Copy link
Collaborator

mogeko commented Jan 6, 2023

<<134, 145, 65, 194, 112, 216, 176, 136, 44, 184, 247, 245, 170, 31, 137, 120, 193, 96, 57, 114>> is a legal info_hash.

But String.lenght/1 thinks its length is 19.

iex> <<134, 145, 65, 194, 112, 216, 176, 136, 44, 184, 247, 245, 170, 31, 137, 120, 193, 96, 57, 114>>
...> |> String.length
19
@mogeko mogeko added the bug Something isn't working label Jan 6, 2023
mogeko added a commit that referenced this issue Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant