From 9dc3e3ce5643c2fcb45fed3fa548edf235ac116e Mon Sep 17 00:00:00 2001 From: Yves Rutschle Date: Sun, 8 Jan 2023 17:31:05 +0100 Subject: [PATCH] connection loss before it is logged resulted in logging uninitialised characters --- log.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/log.c b/log.c index 3204595..57281a1 100644 --- a/log.c +++ b/log.c @@ -194,7 +194,10 @@ void log_connection(struct connection_desc* desc, const struct connection *cnx) if (!desc) { desc = &d; - get_connection_desc(desc, cnx); + if (!get_connection_desc(desc, cnx)) { + print_message(msg_connections, "%s: lost incoming connection\n"); + return; + } } print_message(msg_connections, "%s:connection from %s to %s forwarded from %s to %s\n",