From 3f06423c56d40f269c6c649ba942356dba041748 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 27 Oct 2015 09:18:06 +0000 Subject: [PATCH] The format callback may not always succeed, so we need to check for NULL. From Patrick Palka. --- usr.bin/tmux/format.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.bin/tmux/format.c b/usr.bin/tmux/format.c index 2a65422fea6..f449651804d 100644 --- a/usr.bin/tmux/format.c +++ b/usr.bin/tmux/format.c @@ -1,4 +1,4 @@ -/* $OpenBSD: format.c,v 1.87 2015/10/25 22:29:17 nicm Exp $ */ +/* $OpenBSD: format.c,v 1.88 2015/10/27 09:18:06 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott @@ -643,6 +643,8 @@ format_find(struct format_tree *ft, const char *key, int modifiers) return (NULL); found: + if (found == NULL) + return (NULL); copy = xstrdup(found); if (modifiers & FORMAT_BASENAME) { saved = copy; -- 2.20.1