Commit 9c8778b1 authored by David Woodhouse's avatar David Woodhouse

Merge branch 'multiple_search_domains_GPST' into 'master'

Don't segfault when search domain list is empty (and thus `domains->pos == 0`)

See merge request openconnect/openconnect!11
parents 6d721234 47462081
......@@ -509,7 +509,7 @@ static int gpst_parse_config_xml(struct openconnect_info *vpninfo, xmlNode *xml_
for (member = xml_node->children; member; member=member->next)
if (!xmlnode_get_val(member, "member", &s))
buf_append(domains, "%s ", s);
if (buf_error(domains) == 0) {
if (buf_error(domains) == 0 && domains->pos > 0) {
domains->data[domains->pos-1] = '\0';
vpninfo->ip_info.domain = add_option(vpninfo, "search", &domains->data);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment