aboutsummaryrefslogtreecommitdiff
path: root/server-msg.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-06-25 15:59:42 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-06-25 15:59:42 +0000
commit7be69bfa031477c353368caa83e986b250bf6e10 (patch)
tree2ed68da176ca622f83238386616e7f9d9a914e02 /server-msg.c
parent6f4600c533d370c6020835c786ebedaed00fcaf0 (diff)
downloadrtmux-7be69bfa031477c353368caa83e986b250bf6e10.tar.gz
rtmux-7be69bfa031477c353368caa83e986b250bf6e10.tar.bz2
rtmux-7be69bfa031477c353368caa83e986b250bf6e10.zip
Terminate cwd buffer before running xstrdup on it.
Diffstat (limited to 'server-msg.c')
-rw-r--r--server-msg.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/server-msg.c b/server-msg.c
index af96c07e..2bd6ef81 100644
--- a/server-msg.c
+++ b/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);