From: Timo Sirainen Date: Wed, 22 Oct 2025 12:33:59 +0000 (+0300) Subject: auth: ldap - Make sure ldap log prefix doesn't contain (null) X-Git-Tag: 2.4.2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23427b6440550ca7e01f2c3ac8821350280d30d6;p=thirdparty%2Fdovecot%2Fcore.git auth: ldap - Make sure ldap log prefix doesn't contain (null) This could have happened with invalid ldap_uris. --- diff --git a/src/auth/db-ldap.c b/src/auth/db-ldap.c index 9e0bc14d1d..e71f115e18 100644 --- a/src/auth/db-ldap.c +++ b/src/auth/db-ldap.c @@ -781,7 +781,9 @@ db_ldap_add_connection_callback(LDAP *ld ATTR_UNUSED, Sockbuf *sb ATTR_UNUSED, { struct ldap_connection *conn = ctx->lc_arg; const char *prefix = t_strdup_printf("ldap(%s://%s:%d): ", - srv->lud_scheme, srv->lud_host, srv->lud_port); + srv->lud_scheme != NULL ? srv->lud_scheme : "", + srv->lud_host != NULL ? srv->lud_host : "", + srv->lud_port); if (strcmp(conn->log_prefix, prefix) != 0) { i_free(conn->log_prefix);