From 49b428fda8cf6fa909187433c13b210ef16559e3 Mon Sep 17 00:00:00 2001 From: Daniel Lenski Date: Tue, 27 Apr 2021 12:12:56 -0700 Subject: [PATCH] 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 --- fortinet.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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; -- 2.50.1