diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2021-08-12 08:10:21 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2021-08-12 08:10:21 +0000 |
commit | 63b7178131d95c9f225c82dbf7fd25b7db34c4c2 (patch) | |
tree | c57ca43c90f72952f1552deda47c7773f6ee2b7b /usr.bin/tmux | |
parent | 6271db50696eb1f7366bbeb7ab72dc159c0e397e (diff) |
Do not dereference pane when it is NULL, fixes a crash when creating a
hook from the config, GitHub issue 2820.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r-- | usr.bin/tmux/format.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/notify.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/tmux/format.c b/usr.bin/tmux/format.c index 9f788687e43..228a38c32fe 100644 --- a/usr.bin/tmux/format.c +++ b/usr.bin/tmux/format.c @@ -1,4 +1,4 @@ -/* $OpenBSD: format.c,v 1.289 2021/08/12 08:05:11 nicm Exp $ */ +/* $OpenBSD: format.c,v 1.290 2021/08/12 08:10:20 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -3098,7 +3098,7 @@ format_log_debug_cb(const char *key, const char *value, void *arg) void format_log_debug(struct format_tree *ft, const char *prefix) { - format_each(ft, format_log_debug_cb, prefix); + format_each(ft, format_log_debug_cb, (void *)prefix); } /* Walk each format. */ diff --git a/usr.bin/tmux/notify.c b/usr.bin/tmux/notify.c index 69d8ce1ffc5..44bb7348bc7 100644 --- a/usr.bin/tmux/notify.c +++ b/usr.bin/tmux/notify.c @@ -1,4 +1,4 @@ -/* $OpenBSD: notify.c,v 1.38 2021/08/12 08:05:11 nicm Exp $ */ +/* $OpenBSD: notify.c,v 1.39 2021/08/12 08:10:20 nicm Exp $ */ /* * Copyright (c) 2012 George Nachman <tmux@georgester.com> @@ -200,7 +200,7 @@ notify_hook(struct cmdq_item *item, const char *name) ne.client = cmdq_get_client(item); ne.session = target->s; ne.window = target->w; - ne.pane = target->wp->id; + ne.pane = (target->wp != NULL ? target->wp->id : -1); ne.formats = format_create(NULL, NULL, 0, FORMAT_NOJOBS); format_add(ne.formats, "hook", "%s", name); |