hostname were limited to 62 char, which is not RFC1035 compliant; simply remove equality in condition as counter is initialised at zero. (also simplify brackets for readability)
this should github issue #387 Signed-off-by: William Dauchy <w.dau...@criteo.com> --- src/dns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dns.c b/src/dns.c index eefd8d0dc..8b3a0927e 100644 --- a/src/dns.c +++ b/src/dns.c @@ -1497,7 +1497,7 @@ int dns_hostname_validation(const char *string, char **err) d++; } - if ((i >= DNS_MAX_LABEL_SIZE) && (d[i] != '.')) { + if (i > DNS_MAX_LABEL_SIZE && d[i] != '.') { if (err) *err = DNS_LABEL_TOO_LONG; return 0; -- 2.24.1