some code fixes

This commit is contained in:
bol-van
2024-08-18 12:19:49 +03:00
parent abcfa61168
commit 177dda3760
4 changed files with 39 additions and 24 deletions

View File

@@ -271,7 +271,7 @@ static bool TLSExtractHostFromExt(const uint8_t *ext, size_t elen, char *host, s
size_t slen = pntoh16(ext + 3);
ext += 5; elen -= 5;
if (slen < elen) return false;
if (ext && len_host)
if (host && len_host)
{
if (slen >= len_host) slen = len_host - 1;
for (size_t i = 0; i < slen; i++) host[i] = tolower(ext[i]);