From: Timo Sirainen Date: Tue, 21 Sep 2021 15:26:53 +0000 (+0300) Subject: doveconf: Avoid unnecessary data stack use when writing output X-Git-Tag: 2.3.17~71 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9055758361293ba5be41e9c2e97bfb9b8bf20fa4;p=thirdparty%2Fdovecot%2Fcore.git doveconf: Avoid unnecessary data stack use when writing output --- diff --git a/src/config/doveconf.c b/src/config/doveconf.c index 821684867d..79ea9e8a1d 100644 --- a/src/config/doveconf.c +++ b/src/config/doveconf.c @@ -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);