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

UdpSocket::bind() accepts invalid IPv6 address #23076

Closed
manuels opened this issue Mar 5, 2015 · 2 comments · Fixed by #23097
Closed

UdpSocket::bind() accepts invalid IPv6 address #23076

manuels opened this issue Mar 5, 2015 · 2 comments · Fixed by #23097

Comments

@manuels
Copy link

manuels commented Mar 5, 2015

The IPv6 address in

let s = UdpSocket::bind("1200::AB00:1234::2552:7777:1313:34300").unwrap();

is invalid because it includes "::" twice. However, this function call returns Ok()

@shepmaster
Copy link
Member

It's also invalid because the last group has 5 digits: 34300

alexcrichton added a commit to alexcrichton/rust that referenced this issue Mar 6, 2015
The `rsplitn` call was called with 2 instead of 1 so the iterator would yield 3
items in some cases, not the 2 that it should have.

Closes rust-lang#23076
Manishearth added a commit to Manishearth/rust that referenced this issue Mar 6, 2015
 The `rsplitn` call was called with 2 instead of 1 so the iterator would yield 3
items in some cases, not the 2 that it should have.

Closes rust-lang#23076
alexcrichton added a commit to alexcrichton/rust that referenced this issue Mar 6, 2015
The `rsplitn` call was called with 2 instead of 1 so the iterator would yield 3
items in some cases, not the 2 that it should have.

Closes rust-lang#23076
@manuels
Copy link
Author

manuels commented Mar 7, 2015

Great, thanks guys!

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Mar 21, 2020
…-23076, r=LukasKalbertodt

For issue 53957: revise unit test to focus on underlying bug of 23076.

Fix rust-lang#53957 by revising unit test to focus on underlying bug of rust-lang#23076.

Namely, this version focuses on the end-to-end behavior that the attempt to create the UDP binding will fail, regardless of the semantics of how particular DNS servers handle junk inputs.

(I spent some time trying to create a second more-focused test that would sidestep the DNS resolution, but this is not possible without more invasive changes to the internal infrastructure of `ToSocketAddrs` and what not. It is not worth it.)
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Mar 21, 2020
…-23076, r=LukasKalbertodt

For issue 53957: revise unit test to focus on underlying bug of 23076.

Fix rust-lang#53957 by revising unit test to focus on underlying bug of rust-lang#23076.

Namely, this version focuses on the end-to-end behavior that the attempt to create the UDP binding will fail, regardless of the semantics of how particular DNS servers handle junk inputs.

(I spent some time trying to create a second more-focused test that would sidestep the DNS resolution, but this is not possible without more invasive changes to the internal infrastructure of `ToSocketAddrs` and what not. It is not worth it.)
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.

3 participants