From 0246406bd448c4468d5dcbfda191abbb01c4578b Mon Sep 17 00:00:00 2001 From: Daniel Lenski Date: Sun, 15 Mar 2020 17:05:05 -0700 Subject: [PATCH] fail if GP portal config contains no gateways (rather than simply attempting to continue with same server) Signed-off-by: Daniel Lenski --- auth-globalprotect.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/auth-globalprotect.c b/auth-globalprotect.c index 036c595d..147d4db2 100644 --- a/auth-globalprotect.c +++ b/auth-globalprotect.c @@ -434,6 +434,12 @@ static int parse_portal_xml(struct openconnect_info *vpninfo, xmlNode *xml_node, choice->label, choice->name); } } + if (!opt->nr_choices) { + vpn_progress(vpninfo, PRG_ERR, + _("GlobalProtect portal configuration lists no gateway servers.\n")); + result = -EINVAL; + goto out; + } if (!vpninfo->authgroup && opt->nr_choices) vpninfo->authgroup = strdup(opt->choices[0]->name); -- 2.50.1