summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2015-11-24 09:34:55 +0000
committernicm <nicm@openbsd.org>2015-11-24 09:34:55 +0000
commit29ab08f52c74b55261b2bcaaa7c050e6131dbfaa (patch)
treeed7a1c1becd51fac3594295bd4d5084cd1bd9c14
parentDocument that these functions are now in strings.h. (diff)
downloadwireguard-openbsd-29ab08f52c74b55261b2bcaaa7c050e6131dbfaa.tar.xz
wireguard-openbsd-29ab08f52c74b55261b2bcaaa7c050e6131dbfaa.zip
Don't allow options in table without scope set.
-rw-r--r--usr.bin/tmux/options-table.c4
-rw-r--r--usr.bin/tmux/tmux.h3
2 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/tmux/options-table.c b/usr.bin/tmux/options-table.c
index ff070c52b04..2f73cf780d4 100644
--- a/usr.bin/tmux/options-table.c
+++ b/usr.bin/tmux/options-table.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: options-table.c,v 1.68 2015/11/22 18:28:01 tim Exp $ */
+/* $OpenBSD: options-table.c,v 1.69 2015/11/24 09:34:55 nicm Exp $ */
/*
* Copyright (c) 2011 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -892,6 +892,8 @@ options_table_populate_tree(enum options_table_scope scope, struct options *oo)
const struct options_table_entry *oe;
for (oe = options_table; oe->name != NULL; oe++) {
+ if (oe->scope == OPTIONS_TABLE_NONE)
+ fatalx("no scope for %s", oe->name);
if (oe->scope != scope)
continue;
switch (oe->type) {
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index 5747a528c78..b14354e9574 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.586 2015/11/23 23:47:57 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.587 2015/11/24 09:34:55 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -1394,6 +1394,7 @@ enum options_table_type {
OPTIONS_TABLE_STYLE
};
enum options_table_scope {
+ OPTIONS_TABLE_NONE,
OPTIONS_TABLE_SERVER,
OPTIONS_TABLE_SESSION,
OPTIONS_TABLE_WINDOW,