From a7f0c456abbd512ed6067ed46f60706e29161f47 Mon Sep 17 00:00:00 2001 From: Yves Rutschle Date: Sun, 17 Dec 2017 14:55:51 +0100 Subject: [PATCH] die if target cannot be resolved (otherwise, we segfault when printing the settings or later) --- sslh-main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sslh-main.c b/sslh-main.c index eb89a04..25e23cd 100644 --- a/sslh-main.c +++ b/sslh-main.c @@ -312,7 +312,10 @@ static int config_protocols(config_t *config, struct proto **prots) p->log_level = 1; } - resolve_split_name(&(p->saddr), hostname, port); + if (resolve_split_name(&(p->saddr), hostname, port)) { + fprintf(stderr, "line %d: cannot resolve %s:%s\n", config_setting_source_line(prot), hostname, port); + exit(1); + } p->probe = get_probe(name); if (!p->probe || !strcmp(name, "sni_alpn")) {