main: don't attempt to access client configuration if not already set

This prevents crash introduced by cefd77b633
This commit is contained in:
Nikos Mavrogiannopoulos
2016-01-27 14:22:20 +01:00
parent 22b7df3131
commit b66b1f6390

View File

@@ -345,7 +345,6 @@ static int append_user_info(method_ctx *ctx,
rep->conn_time = ctmp->conn_time;
rep->hostname = ctmp->hostname;
rep->user_agent = ctmp->user_agent;
rep->restrict_to_routes = ctmp->config->restrict_user_to_routes;
if (ctmp->status == PS_AUTH_COMPLETED)
strtmp = "connected";
@@ -369,6 +368,9 @@ static int append_user_info(method_ctx *ctx,
rep->has_mtu = 1;
}
if (ctmp->config) {
rep->restrict_to_routes = ctmp->config->restrict_user_to_routes;
tmp = ctmp->config->rx_per_sec;
tmp *= 1000;
rep->rx_per_sec = tmp;
@@ -400,6 +402,7 @@ static int append_user_info(method_ctx *ctx,
rep->n_fw_ports = ctmp->config->n_fw_ports;
rep->fw_ports = ctmp->config->fw_ports;
}
return 0;
}