Apply length limits and substitution even to literal formats.

pull/1633/head
nicm 2019-03-13 14:27:17 +00:00
parent 9032ac2a05
commit 49f04a997a
1 changed files with 1 additions and 1 deletions

View File

@ -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) {