Skip to content

Commit

Permalink
Fix c89 compilation support broken by .onion rejection changes
Browse files Browse the repository at this point in the history
Move .onion check lower after all variables have been declared.

Bug: #246
  • Loading branch information
Brad House committed May 2, 2019
1 parent 4160535 commit 9f1fdbf
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ares_gethostbyname.c
Expand Up @@ -346,10 +346,6 @@ static int file_lookup(const char *name, int family, struct hostent **host)
int status;
int error;

/* Per RFC 7686, reject queries for ".onion" domain names with NXDOMAIN. */
if (ares__is_onion_domain(name))
return ARES_ENOTFOUND;

#ifdef WIN32
char PATH_HOSTS[MAX_PATH];
win_platform platform;
Expand Down Expand Up @@ -387,6 +383,11 @@ static int file_lookup(const char *name, int family, struct hostent **host)
return ARES_ENOTFOUND;
#endif

/* Per RFC 7686, reject queries for ".onion" domain names with NXDOMAIN. */
if (ares__is_onion_domain(name))
return ARES_ENOTFOUND;


fp = fopen(PATH_HOSTS, "r");
if (!fp)
{
Expand Down

0 comments on commit 9f1fdbf

Please sign in to comment.