Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't append port number to hostname when canonicalising
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Feb 5, 2013
1 parent b37161f commit 3e6ecfa
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions ssl.c
Expand Up @@ -251,7 +251,7 @@ int connect_https_socket(struct openconnect_info *vpninfo)
ensure that we output the same IP address in authentication
results (from libopenconnect or --authenticate). */
if (!vpninfo->proxy && (rp != result || rp->ai_next) && host[0]) {
char *p = malloc(strlen(host) + 9);
char *p = malloc(strlen(host) + 3);
if (p) {
free(vpninfo->hostname);
vpninfo->hostname = p;
Expand All @@ -261,11 +261,7 @@ int connect_https_socket(struct openconnect_info *vpninfo)
p += strlen(host);
if (rp->ai_family == AF_INET6)
*p++ = ']';

if (vpninfo->port != 443)
snprintf(p, 7, ":%d", vpninfo->port);
else
*p = 0;
*p = 0;
}
}
break;
Expand Down

0 comments on commit 3e6ecfa

Please sign in to comment.