Merge pull request #20 from daramos/numeric_fqdn

Allow numeric subdomains in is_fqdn
pull/26/head
Max 2018-11-27 23:48:37 +01:00 committed by GitHub
commit 5fb99c6d0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 7 deletions

View File

@ -489,7 +489,6 @@ gboolean is_fqdn(char *addr)
// iterate over all parts of the name // iterate over all parts of the name
for(idx = 0; idx <= dots; idx++){ for(idx = 0; idx <= dots; idx++){
contains_alpha = FALSE;
// if the part is empty // if the part is empty
if(is_empty(parts[idx])){ if(is_empty(parts[idx])){
@ -521,12 +520,13 @@ gboolean is_fqdn(char *addr)
idx2++; idx2++;
} }
}
// names consisting of only numbers are not legitimate // names consisting of only numbers are not legitimate
if(!contains_alpha){ if(!contains_alpha){
success = FALSE; success = FALSE;
goto fqdn_end; goto fqdn_end;
} }
}
// might have a port suffix after a colon (e.g. tuwien.ac.at:8080) // might have a port suffix after a colon (e.g. tuwien.ac.at:8080)
if(g_strrstr(lastpart, ":")){ if(g_strrstr(lastpart, ":")){