From: Daniel Lenski Date: Tue, 27 Apr 2021 19:12:56 +0000 (-0700) Subject: Fix sloppy cookie construction for Fortinet X-Git-Tag: v8.20~255 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=49b428fda8cf6fa909187433c13b210ef16559e3;p=users%2Fdwmw2%2Fopenconnect.git Fix sloppy cookie construction for Fortinet Using the "default" cookie behavior of internal_split_cookies() should be a fallback, not the standard behavior. Signed-off-by: Daniel Lenski --- diff --git a/fortinet.c b/fortinet.c index bbb86e19..5b103170 100644 --- a/fortinet.c +++ b/fortinet.c @@ -199,8 +199,7 @@ int fortinet_obtain_cookie(struct openconnect_info *vpninfo) for (cookie = vpninfo->cookies; cookie; cookie = cookie->next) { if (!strcmp(cookie->option, "SVPNCOOKIE")) { free(vpninfo->cookie); - vpninfo->cookie = strdup(cookie->value); - if (!vpninfo->cookie) + if (asprintf(&vpninfo->cookie, "SVPNCOOKIE=%s", cookie->value) < 0) goto nomem; ret = 0; goto out;