summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-06-05 11:14:14 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-06-05 11:14:14 +0000
commit469bd0bed7e9bdffe5d255ac77d319b97ec9c7b7 (patch)
tree79f69cf6fb00cc07809244301cd13a845a6f652e
parent7a55a9ec252cc07a8443ba6ccf6a54de29294b43 (diff)
Terminate cwd buffer before running xstrdup on it.
-rw-r--r--usr.bin/tmux/server-msg.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/tmux/server-msg.c b/usr.bin/tmux/server-msg.c
index af96c07e4a5..2bd6ef813cc 100644
--- a/usr.bin/tmux/server-msg.c
+++ b/usr.bin/tmux/server-msg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server-msg.c,v 1.2 2009/06/04 21:43:24 nicm Exp $ */
+/* $OpenBSD: server-msg.c,v 1.3 2009/06/05 11:14:13 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -196,6 +196,7 @@ server_msg_fn_identify(struct hdr *hdr, struct client *c)
c->tty.sy = data.sy;
c->cwd = NULL;
+ data.cwd[(sizeof data.cwd) - 1] = '\0';
if (*data.cwd != '\0')
c->cwd = xstrdup(data.cwd);