]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
bugfix internal_get_url
authorDaniel Lenski <dlenski@gmail.com>
Thu, 1 Apr 2021 20:09:58 +0000 (13:09 -0700)
committerDaniel Lenski <dlenski@gmail.com>
Thu, 1 Apr 2021 20:10:14 +0000 (13:10 -0700)
Don't want (null) jammed into our URLs. I broke this in c8ca180f02a569e6692c699eb8aa70df976d49a5.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
http.c

diff --git a/http.c b/http.c
index 8bd60451a70903d77086d89ab69395d2055bbfc8..261cf91664157163c82a31870fa603a1c54698f1 100644 (file)
--- a/http.c
+++ b/http.c
@@ -855,7 +855,8 @@ int internal_parse_url(const char *url, char **res_proto, char **res_host,
 char *internal_get_url(struct openconnect_info *vpninfo)
 {
        char *url;
-       if (asprintf(&url, "https://%s%s%s", vpninfo->hostname, vpninfo->urlpath ? "/" : "", vpninfo->urlpath) < 0)
+       if (asprintf(&url, "https://%s%s%s", vpninfo->hostname,
+                    vpninfo->urlpath ? "/" : "", vpninfo->urlpath ? : "") < 0)
                return NULL;
        else
                return url;