From 777055274c4a1959318330800e449a2bc27835fb Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Fri, 23 Apr 2021 00:47:15 +0200 Subject: [PATCH] Fix a potential segmentation fault when log level is set to DEBUG. --- src/protocol_key.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/protocol_key.c b/src/protocol_key.c index b2ba50fe..25dbc55e 100644 --- a/src/protocol_key.c +++ b/src/protocol_key.c @@ -278,7 +278,7 @@ static bool req_key_ext_h(meshlink_handle_t *mesh, connection_t *c, const char * char *canonical_address; xasprintf(&canonical_address, "%s %s", host, port); - if(mesh->log_level <= MESHLINK_DEBUG && strcmp(from->canonical_address, canonical_address)) { + if(mesh->log_level <= MESHLINK_DEBUG && (!from->canonical_address || strcmp(from->canonical_address, canonical_address))) { logger(mesh, MESHLINK_DEBUG, "Updating canonical address of %s to %s", from->name, canonical_address); } -- 2.39.5