diff --git a/cmd-show-options.c b/cmd-show-options.c index 0e973ea0..90226ad3 100644 --- a/cmd-show-options.c +++ b/cmd-show-options.c @@ -126,6 +126,12 @@ cmd_show_options_exec(struct cmd *self, struct cmdq_item *item) parent = 0; if (o != NULL) cmd_show_options_print(self, item, o, idx, parent); + else if (*name == '@') { + if (args_has(args, 'q')) + goto fail; + cmdq_error(item, "invalid option: %s", argument); + goto fail; + } free(name); free(argument); diff --git a/tty-keys.c b/tty-keys.c index 6dfa70f3..65b600c0 100644 --- a/tty-keys.c +++ b/tty-keys.c @@ -1204,6 +1204,9 @@ tty_keys_clipboard(__unused struct tty *tty, const char *buf, size_t len, buf += 5; end -= 5; + /* Adjust end so that it points to the start of the terminator. */ + end -= terminator - 1; + /* Get the second argument. */ while (end != 0 && *buf != ';') { buf++;