summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-load-buffer.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2016-03-05 07:47:52 +0000
committernicm <nicm@openbsd.org>2016-03-05 07:47:52 +0000
commitb0cf51d774f363ec79dd554442667acbad1a3184 (patch)
treebed397ac601db296bbef57e65935f76c53e107a5 /usr.bin/tmux/cmd-load-buffer.c
parentKNF: wrap three overly long lines. No binary change. (diff)
downloadwireguard-openbsd-b0cf51d774f363ec79dd554442667acbad1a3184.tar.xz
wireguard-openbsd-b0cf51d774f363ec79dd554442667acbad1a3184.zip
Do not use c->cwd or s->cwd if it is NULL, found by Ben Boeckel.
Diffstat (limited to 'usr.bin/tmux/cmd-load-buffer.c')
-rw-r--r--usr.bin/tmux/cmd-load-buffer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/tmux/cmd-load-buffer.c b/usr.bin/tmux/cmd-load-buffer.c
index 058a85b0b19..3152b326a21 100644
--- a/usr.bin/tmux/cmd-load-buffer.c
+++ b/usr.bin/tmux/cmd-load-buffer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-load-buffer.c,v 1.41 2015/12/13 21:53:57 nicm Exp $ */
+/* $OpenBSD: cmd-load-buffer.c,v 1.42 2016/03/05 07:47:52 nicm Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
@@ -73,9 +73,9 @@ cmd_load_buffer_exec(struct cmd *self, struct cmd_q *cmdq)
return (CMD_RETURN_WAIT);
}
- if (c != NULL && c->session == NULL)
+ if (c != NULL && c->session == NULL && c->cwd != NULL)
cwd = c->cwd;
- else if ((s = c->session) != NULL)
+ else if ((s = c->session) != NULL && s->cwd != NULL)
cwd = s->cwd;
else
cwd = ".";