]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Don't append port number to hostname when canonicalising
authorDavid Woodhouse <David.Woodhouse@intel.com>
Tue, 5 Feb 2013 00:21:08 +0000 (00:21 +0000)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Tue, 5 Feb 2013 00:21:08 +0000 (00:21 +0000)
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
ssl.c

diff --git a/ssl.c b/ssl.c
index 05e41568a202b5b24ee64cac63c76c00f1b30a94..d6a551a444107e34a2cdc15dfda3dc8d0bf6a0d5 100644 (file)
--- a/ssl.c
+++ b/ssl.c
@@ -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;
@@ -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;