Skip to content

Commit

Permalink
don't reject queried or loaded hostnames based on "acceptable" charac…
Browse files Browse the repository at this point in the history
…ters. (#586)
  • Loading branch information
scareything committed Jan 11, 2023
1 parent 9680352 commit 3b5a852
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/ziti-tunnel-cbs/ziti_dns.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,17 +267,17 @@ static bool check_name(const char *name, char clean_name[MAX_DNS_NAME], bool *is
if (is_domain) *is_domain = false;
}

bool need_alphanum = true;
bool success = true;
while (*hp != '\0') {
if (!isalnum(*hp) && *hp != '-' && *hp != '.') { return false; }
if (!isalnum(*hp) && need_alphanum) return false;

need_alphanum = *hp == '.';

*p++ = (char) tolower(*hp++);
if (p - clean_name >= MAX_DNS_NAME) {
p = clean_name;
success = false;
break;
}
}
*p = '\0';
return true;
return success;
}

static dns_entry_t* new_ipv4_entry(const char *host) {
Expand Down

0 comments on commit 3b5a852

Please sign in to comment.