summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2022-01-17 10:40:04 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2022-01-17 10:40:04 +0000
commit4e33ae3109ac840dc5ecaebf9cdd75f800d1c430 (patch)
tree2f9f61ee0ba9999c480f4e8898ac43d3cfcccf57
parentf565d1fe4f70b87c513f5f1aa80bec8bf56358b4 (diff)
Do not try to strdup NULL, from seL4 at disroot dot org in GitHub issue
3038.
-rw-r--r--usr.bin/tmux/popup.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/tmux/popup.c b/usr.bin/tmux/popup.c
index f1e6cba5fdf..07f57ab8d61 100644
--- a/usr.bin/tmux/popup.c
+++ b/usr.bin/tmux/popup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: popup.c,v 1.42 2021/10/25 09:38:36 nicm Exp $ */
+/* $OpenBSD: popup.c,v 1.43 2022/01/17 10:40:03 nicm Exp $ */
/*
* Copyright (c) 2020 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -668,7 +668,8 @@ popup_display(int flags, enum box_lines lines, struct cmdq_item *item, u_int px,
pd = xcalloc(1, sizeof *pd);
pd->item = item;
pd->flags = flags;
- pd->title = xstrdup(title);
+ if (title != NULL)
+ pd->title = xstrdup(title);
pd->c = c;
pd->c->references++;