Merge pull request #1922 from pi-hole/tweak/tld_checks

Allow one-character TLDs in hostname validation
This commit is contained in:
Dominik 2024-03-30 06:40:03 +01:00 committed by GitHub
commit ea9005693e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 0 additions and 6 deletions

View File

@ -94,12 +94,6 @@ inline bool __attribute__((pure)) valid_domain(const char *domain, const size_t
if(domain[last_dot + 1] == '-' || domain[len - 1] == '-')
return false;
// TLD length check
// The last label must be at least 2 characters long
// (len-1) because we start counting from zero
if((len - 1) - last_dot < 2)
return false;
return true;
}