summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2021-10-21 12:01:10 +0100
committerThomas Adam <thomas@xteddy.org>2021-10-21 12:01:10 +0100
commitbe2413292f6e94aca0a5c707254db62a2b186f84 (patch)
tree2739127739d5dba9b10a4e7aec3c423bae683c0b
parent1bf2f811ea8835dd24bdb773b5be4df517767d1f (diff)
parent289ac55ebde18df237ad21734ba4056896d11022 (diff)
Merge branch 'obsd-master' into master
-rw-r--r--cmd-show-options.c6
-rw-r--r--tty-keys.c3
2 files changed, 9 insertions, 0 deletions
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++;