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

Fix panic in Domain::assemble caused by having a single label with trailing dot #9

Merged
merged 1 commit into from
Aug 7, 2017

Conversation

jonasbb
Copy link
Contributor

@jonasbb jonasbb commented Aug 7, 2017

Domain::find_match miscounts the labels as being 2, if there is a single
label with a trailing dot causing an index out of range panic.

Fixes #8

I just double checked that it still errors for double trailing dots. For everything parsed with parse_domain the check in line 668 catches it. For parse_dns_name the to_ascii method errors with a TooShortForDns.

It might make sense to replace the ? with a chain_err and also convert it into InvalidDomain, but thats a different issue.

…ailing dot

Domain::find_match miscounts the labels as being 2, if there is a single
label with a trailing dot causing an index out of range panic.
@rushmorem
Copy link
Owner

Looks good. Thank you :)

@rushmorem rushmorem merged commit 2554b32 into rushmorem:master Aug 7, 2017
@rushmorem
Copy link
Owner

It might make sense to replace the ? with a chain_err and also convert it into InvalidDomain, but thats a different issue.

It does. Would you like to tackle this as well?

@jonasbb jonasbb deleted the fix-8 branch August 7, 2017 20:08
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.

Inconsistent handling of trailing dots can lead to panic
2 participants