mirror of
https://github.com/nmap/nmap.git
synced 2026-05-13 08:46:45 +00:00
Fix memory leak in Ncat's SSL validation
This commit is contained in:
parent
9351c41147
commit
d39b20c6a3
1 changed files with 7 additions and 3 deletions
|
|
@ -267,6 +267,7 @@ static int cert_match_dnsname(X509 *cert, const char *hostname,
|
|||
const X509V3_EXT_METHOD *method;
|
||||
unsigned char *data;
|
||||
int i;
|
||||
int ret = 0;
|
||||
|
||||
if (num_checked != NULL)
|
||||
*num_checked = 0;
|
||||
|
|
@ -327,12 +328,15 @@ static int cert_match_dnsname(X509 *cert, const char *hostname,
|
|||
logdebug("Checking certificate DNS name \"%.*s\" against \"%s\".\n", dnslen, dnsname, hostname);
|
||||
if (num_checked != NULL)
|
||||
(*num_checked)++;
|
||||
if (wildcard_match(dnsname, hostname, dnslen))
|
||||
return 1;
|
||||
if (wildcard_match(dnsname, hostname, dnslen)) {
|
||||
ret = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
sk_GENERAL_NAME_pop_free(gen_names, GENERAL_NAME_free);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Returns the number of contiguous blocks of bytes in pattern that do not
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue