diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2017-01-10 18:10:25 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2017-01-10 18:10:25 +0000 |
commit | f74af1c7c4423f7160e46d8dd1bb914ff18bc206 (patch) | |
tree | 2534ba8f3eef67ca8ee562a7374df2a71a996413 /usr.bin | |
parent | 2c8a80da7520bb28c8b07ecd30db54a671c0f770 (diff) |
Need to escape ; twice because the command list parser will eat one,
reported by Theo Buehler.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tmux/cmd.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/tmux/cmd.c b/usr.bin/tmux/cmd.c index 5703e6f5ab3..46534f72495 100644 --- a/usr.bin/tmux/cmd.c +++ b/usr.bin/tmux/cmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd.c,v 1.131 2017/01/10 11:58:30 nicm Exp $ */ +/* $OpenBSD: cmd.c,v 1.132 2017/01/10 18:10:24 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -690,10 +690,14 @@ cmd_template_replace(const char *template, const char *s, int idx) if (quoted) ptr++; - buf = xrealloc(buf, len + (strlen(s) * 2) + 1); + buf = xrealloc(buf, len + (strlen(s) * 3) + 1); for (cp = s; *cp != '\0'; cp++) { if (quoted && strchr(quote, *cp) != NULL) buf[len++] = '\\'; + if (quoted && *cp == ';') { + buf[len++] = '\\'; + buf[len++] = '\\'; + } buf[len++] = *cp; } buf[len] = '\0'; |