Skip to content

Commit

Permalink
Check ASN1_STRING_to_UTF8 return value.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Marriott committed Feb 15, 2014
1 parent 1733522 commit e010c7e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ check_alt_names(char *host, char *fqdn, X509 *x509)
p = sk_GENERAL_NAME_value(ans, n);
if (p == NULL || p->type != GEN_DNS)
continue;
ASN1_STRING_to_UTF8((u_char **)&buf, p->d.dNSName);
if (buf == NULL)
if (ASN1_STRING_to_UTF8((u_char **)&buf, p->d.dNSName) <= 0)
continue;
if (fnmatch(buf, host, FNM_NOESCAPE|FNM_CASEFOLD) == 0 ||
(fqdn != NULL &&
Expand Down

0 comments on commit e010c7e

Please sign in to comment.