diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2019-03-13 14:27:18 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2019-03-13 14:27:18 +0000 |
commit | ffc67f1112d1b05fd350c628387df91cf8706d5a (patch) | |
tree | 1c5e1b575e001e3792040f77bbd60226058ecead | |
parent | 8ea77c4b11b7f2dc98828741ef2ce61b349aa7ba (diff) |
Apply length limits and substitution even to literal formats.
-rw-r--r-- | usr.bin/tmux/format.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/tmux/format.c b/usr.bin/tmux/format.c index 3f37cc5becd..e3ef8d061e4 100644 --- a/usr.bin/tmux/format.c +++ b/usr.bin/tmux/format.c @@ -1,4 +1,4 @@ -/* $OpenBSD: format.c,v 1.170 2019/03/13 14:19:54 nicm Exp $ */ +/* $OpenBSD: format.c,v 1.171 2019/03/13 14:27:17 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -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) { |