Commit 47462081 authored by Daniel Lenski's avatar Daniel Lenski Committed by David Woodhouse

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

Signed-off-by: default avatarDaniel Lenski <dlenski@gmail.com>
parent 6d721234
......@@ -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