mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 08:46:58 +08:00
main: don't attempt to access client configuration if not already set
This prevents crash introduced by cefd77b633
This commit is contained in:
@@ -345,7 +345,6 @@ static int append_user_info(method_ctx *ctx,
|
|||||||
rep->conn_time = ctmp->conn_time;
|
rep->conn_time = ctmp->conn_time;
|
||||||
rep->hostname = ctmp->hostname;
|
rep->hostname = ctmp->hostname;
|
||||||
rep->user_agent = ctmp->user_agent;
|
rep->user_agent = ctmp->user_agent;
|
||||||
rep->restrict_to_routes = ctmp->config->restrict_user_to_routes;
|
|
||||||
|
|
||||||
if (ctmp->status == PS_AUTH_COMPLETED)
|
if (ctmp->status == PS_AUTH_COMPLETED)
|
||||||
strtmp = "connected";
|
strtmp = "connected";
|
||||||
@@ -369,37 +368,41 @@ static int append_user_info(method_ctx *ctx,
|
|||||||
rep->has_mtu = 1;
|
rep->has_mtu = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp = ctmp->config->rx_per_sec;
|
if (ctmp->config) {
|
||||||
tmp *= 1000;
|
rep->restrict_to_routes = ctmp->config->restrict_user_to_routes;
|
||||||
rep->rx_per_sec = tmp;
|
|
||||||
|
|
||||||
tmp = ctmp->config->tx_per_sec;
|
tmp = ctmp->config->rx_per_sec;
|
||||||
tmp *= 1000;
|
tmp *= 1000;
|
||||||
rep->tx_per_sec = tmp;
|
rep->rx_per_sec = tmp;
|
||||||
|
|
||||||
rep->dpd = ctmp->config->dpd;
|
tmp = ctmp->config->tx_per_sec;
|
||||||
|
tmp *= 1000;
|
||||||
|
rep->tx_per_sec = tmp;
|
||||||
|
|
||||||
rep->keepalive = ctmp->config->keepalive;
|
rep->dpd = ctmp->config->dpd;
|
||||||
rep->domains = ctx->s->config->split_dns;
|
|
||||||
rep->n_domains = ctx->s->config->split_dns_size;
|
|
||||||
|
|
||||||
rep->dns = ctmp->config->dns;
|
rep->keepalive = ctmp->config->keepalive;
|
||||||
rep->n_dns = ctmp->config->n_dns;
|
rep->domains = ctx->s->config->split_dns;
|
||||||
|
rep->n_domains = ctx->s->config->split_dns_size;
|
||||||
|
|
||||||
rep->nbns = ctmp->config->nbns;
|
rep->dns = ctmp->config->dns;
|
||||||
rep->n_nbns = ctmp->config->n_nbns;
|
rep->n_dns = ctmp->config->n_dns;
|
||||||
|
|
||||||
rep->n_routes = ctmp->config->n_routes;
|
rep->nbns = ctmp->config->nbns;
|
||||||
rep->routes = ctmp->config->routes;
|
rep->n_nbns = ctmp->config->n_nbns;
|
||||||
|
|
||||||
rep->n_no_routes = ctmp->config->n_no_routes;
|
rep->n_routes = ctmp->config->n_routes;
|
||||||
rep->no_routes = ctmp->config->no_routes;
|
rep->routes = ctmp->config->routes;
|
||||||
|
|
||||||
rep->iroutes = ctmp->config->iroutes;
|
rep->n_no_routes = ctmp->config->n_no_routes;
|
||||||
rep->n_iroutes = ctmp->config->n_iroutes;
|
rep->no_routes = ctmp->config->no_routes;
|
||||||
|
|
||||||
rep->n_fw_ports = ctmp->config->n_fw_ports;
|
rep->iroutes = ctmp->config->iroutes;
|
||||||
rep->fw_ports = ctmp->config->fw_ports;
|
rep->n_iroutes = ctmp->config->n_iroutes;
|
||||||
|
|
||||||
|
rep->n_fw_ports = ctmp->config->n_fw_ports;
|
||||||
|
rep->fw_ports = ctmp->config->fw_ports;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user