]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveconf: Avoid unnecessary data stack use when writing output
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 21 Sep 2021 15:26:53 +0000 (18:26 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Wed, 22 Sep 2021 11:11:23 +0000 (11:11 +0000)
src/config/doveconf.c

index 821684867d74020c10a99d76577137c5b682034c..79ea9e8a1da23677a03164891c006228c0c08e89 100644 (file)
@@ -77,8 +77,8 @@ config_request_get_strings(const char *key, const char *value,
        case CONFIG_KEY_UNIQUE_KEY:
                p = strrchr(key, '/');
                i_assert(p != NULL);
-               value = p_strdup_printf(ctx->pool, "%s/"UNIQUE_KEY_SUFFIX"%s=%s",
-                                       t_strdup_until(key, p), p + 1, value);
+               value = p_strdup_printf(ctx->pool, "%.*s/"UNIQUE_KEY_SUFFIX"%s=%s",
+                                       (int)(p - key), key, p + 1, value);
                break;
        case CONFIG_KEY_ERROR:
                value = p_strdup(ctx->pool, value);