From 89262c62fe6c49e87f62acfcbb02edc8c8afaf17 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Fri, 5 Jun 2009 11:14:13 +0000 Subject: [PATCH] Terminate cwd buffer before running xstrdup on it. --- server-msg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/server-msg.c b/server-msg.c index 5eaa04db..ef01e100 100644 --- a/server-msg.c +++ b/server-msg.c @@ -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);