Handle "0" in domain names

This commit is contained in:
ValdikSS 2022-03-06 00:22:22 +03:00
parent 8383ecaadf
commit 55a3a94065

View File

@ -415,7 +415,7 @@ static int extract_sni(const char *pktdata, unsigned int pktlen,
} }
/* Validate that hostname has only ascii lowercase characters */ /* Validate that hostname has only ascii lowercase characters */
for (int i=0; i<hnlen; i++) { for (int i=0; i<hnlen; i++) {
if (!( (hnaddr[i] >= '1' && hnaddr[i] <= '9') || if (!( (hnaddr[i] >= '0' && hnaddr[i] <= '9') ||
(hnaddr[i] >= 'a' && hnaddr[i] <= 'z') || (hnaddr[i] >= 'a' && hnaddr[i] <= 'z') ||
hnaddr[i] == '.' || hnaddr[i] == '-')) hnaddr[i] == '.' || hnaddr[i] == '-'))
{ {