From 30d10be4ba38eb86ea3829b2c6fb92f3a70ab2da Mon Sep 17 00:00:00 2001 From: Nick Krylov Date: Thu, 14 Apr 2022 20:02:11 +0300 Subject: [PATCH] Replace comma with space when multiple search domains specified. --- cp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cp.c b/cp.c index 084e5d59..cdbd0979 100644 --- a/cp.c +++ b/cp.c @@ -945,8 +945,11 @@ static int handle_hello_reply(const char *data, struct openconnect_info *vpninfo } opt = cpo_get(cpo, cpo_find_child(cpo, OM_idx, "dns_suffix")); - if (opt && opt->value && strlen(opt->value)) + if (opt && opt->value && strlen(opt->value)) { + /* Multiple values are comma-separated. Replace commas with spaces if any. */ + for (char* pos = opt->value; (pos = strchr(opt->value, ',')) != NULL; *pos = ' '); new_ip_info.domain = add_option_dup(&new_cstp_opts, "search", opt->value, -1); + } idx = cpo_find_child(cpo, OM_idx, "wins_servers"); if (idx >= 0) { -- 2.49.0