]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: ldap - Make sure ldap log prefix doesn't contain (null)
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 22 Oct 2025 12:33:59 +0000 (15:33 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Thu, 23 Oct 2025 11:19:54 +0000 (11:19 +0000)
This could have happened with invalid ldap_uris.

src/auth/db-ldap.c

index 9e0bc14d1d0aa455c4c2c727b026a6ebbbced580..e71f115e187129bfe3396159fc955ddea3fd91c3 100644 (file)
@@ -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);