summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2021-02-27 06:28:16 +0000
committernicm <nicm@openbsd.org>2021-02-27 06:28:16 +0000
commit78cf41711a0bd26a4bcba054a54007df0f5b5bb2 (patch)
treebaeb86b9899ce5893505d75f1b60970120359057
parentregen (diff)
downloadwireguard-openbsd-78cf41711a0bd26a4bcba054a54007df0f5b5bb2.tar.xz
wireguard-openbsd-78cf41711a0bd26a4bcba054a54007df0f5b5bb2.zip
Handle NULL term_type.
-rw-r--r--usr.bin/tmux/format.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/tmux/format.c b/usr.bin/tmux/format.c
index 5980c5d61d2..1b971064088 100644
--- a/usr.bin/tmux/format.c
+++ b/usr.bin/tmux/format.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: format.c,v 1.279 2021/02/26 21:53:41 nicm Exp $ */
+/* $OpenBSD: format.c,v 1.280 2021/02/27 06:28:16 nicm Exp $ */
/*
* Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1368,8 +1368,11 @@ format_cb_client_termname(struct format_tree *ft)
static void *
format_cb_client_termtype(struct format_tree *ft)
{
- if (ft->c != NULL)
+ if (ft->c != NULL) {
+ if (ft->c->term_type == NULL)
+ return (xstrdup(""));
return (xstrdup(ft->c->term_type));
+ }
return (NULL);
}