From 49f04a997a578daff49e4c0b1ed32eb80e7aecfb Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 13 Mar 2019 14:27:17 +0000 Subject: Apply length limits and substitution even to literal formats. --- format.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'format.c') diff --git a/format.c b/format.c index 55cb5028..111d358b 100644 --- a/format.c +++ b/format.c @@ -1293,6 +1293,7 @@ format_replace(struct format_tree *ft, const char *key, size_t keylen, value = xstrdup(""); } +done: /* Expand again if required. */ if (modifiers & FORMAT_EXPAND) { new = format_expand(ft, value); @@ -1318,7 +1319,6 @@ format_replace(struct format_tree *ft, const char *key, size_t keylen, value = new; } -done: /* Expand the buffer and copy in the value. */ valuelen = strlen(value); while (*len - *off < valuelen + 1) { -- cgit v1.2.3