Skip to content

Bugfix DNSClient::getHostByName() #2499

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

Closed
wants to merge 1 commit into from
Closed

Conversation

jhorck
Copy link

@jhorck jhorck commented Dec 15, 2014

I found a bug in DNSClient::getHostByName() and fixed it.

I'm trying to connect to a local server, called 'htpc'. The hostname is resolved by DNSClient::getHostByName(). The first thing this function does is "See if it's a numeric IP address" by calling inet_aton(). It returns falsely 1 (=yes, it's a numeric IP address) for hostname 'htpc'

For most (longer) hostnames it will accidentally return 0. This is probably why it hasn't been discovered before.

  • valid IP address digits have to be >= 0 AND <= 9
  • valid IP addresses must have 4 segments

valid IP address digits have to be >= 0 AND <= 9
valid IP addresses must have 4 segments
@ffissore
Copy link
Contributor

Thank you @jhorck . Do you mind applying your fix to branch 1.5.x? Master is the old 1.0.x series that is phasing out. 1.5.x is soon to become the new stable. On branch 1.5.x we also have a bot that packs the IDE with the proposed fix so that everyone can easily test it. Thank you in advance

@jhorck jhorck changed the title Update Dns.cpp Bugfix DNSClient::getHostByName() Dec 15, 2014
@jhorck
Copy link
Author

jhorck commented Dec 15, 2014

done: #2500
branch ide-1.5.x-java7 is for Java changes only? I assume i don't need to apply my fix in this branch?

@ffissore
Copy link
Contributor

Correct, that's a secondary branch, we merge it manually with ide-1.5.x every once in a while

@ffissore ffissore closed this Jan 8, 2015
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.

2 participants